perf_counter.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. /*
  2. * Performance counters:
  3. *
  4. * Copyright(C) 2008, Thomas Gleixner <tglx@linutronix.de>
  5. * Copyright(C) 2008, Red Hat, Inc., Ingo Molnar
  6. *
  7. * Data type definitions, declarations, prototypes.
  8. *
  9. * Started by: Thomas Gleixner and Ingo Molnar
  10. *
  11. * For licencing details see kernel-base/COPYING
  12. */
  13. #ifndef _LINUX_PERF_COUNTER_H
  14. #define _LINUX_PERF_COUNTER_H
  15. #include <linux/types.h>
  16. #include <linux/ioctl.h>
  17. #include <asm/byteorder.h>
  18. /*
  19. * User-space ABI bits:
  20. */
  21. /*
  22. * attr.type
  23. */
  24. enum perf_event_types {
  25. PERF_TYPE_HARDWARE = 0,
  26. PERF_TYPE_SOFTWARE = 1,
  27. PERF_TYPE_TRACEPOINT = 2,
  28. /*
  29. * available TYPE space, raw is the max value.
  30. */
  31. PERF_TYPE_RAW = 128,
  32. };
  33. /*
  34. * Generalized performance counter event types, used by the attr.event_id
  35. * parameter of the sys_perf_counter_open() syscall:
  36. */
  37. enum attr_ids {
  38. /*
  39. * Common hardware events, generalized by the kernel:
  40. */
  41. PERF_COUNT_CPU_CYCLES = 0,
  42. PERF_COUNT_INSTRUCTIONS = 1,
  43. PERF_COUNT_CACHE_REFERENCES = 2,
  44. PERF_COUNT_CACHE_MISSES = 3,
  45. PERF_COUNT_BRANCH_INSTRUCTIONS = 4,
  46. PERF_COUNT_BRANCH_MISSES = 5,
  47. PERF_COUNT_BUS_CYCLES = 6,
  48. PERF_HW_EVENTS_MAX = 7,
  49. };
  50. /*
  51. * Special "software" counters provided by the kernel, even if the hardware
  52. * does not support performance counters. These counters measure various
  53. * physical and sw events of the kernel (and allow the profiling of them as
  54. * well):
  55. */
  56. enum sw_event_ids {
  57. PERF_COUNT_CPU_CLOCK = 0,
  58. PERF_COUNT_TASK_CLOCK = 1,
  59. PERF_COUNT_PAGE_FAULTS = 2,
  60. PERF_COUNT_CONTEXT_SWITCHES = 3,
  61. PERF_COUNT_CPU_MIGRATIONS = 4,
  62. PERF_COUNT_PAGE_FAULTS_MIN = 5,
  63. PERF_COUNT_PAGE_FAULTS_MAJ = 6,
  64. PERF_SW_EVENTS_MAX = 7,
  65. };
  66. #define __PERF_COUNTER_MASK(name) \
  67. (((1ULL << PERF_COUNTER_##name##_BITS) - 1) << \
  68. PERF_COUNTER_##name##_SHIFT)
  69. #define PERF_COUNTER_RAW_BITS 1
  70. #define PERF_COUNTER_RAW_SHIFT 63
  71. #define PERF_COUNTER_RAW_MASK __PERF_COUNTER_MASK(RAW)
  72. #define PERF_COUNTER_CONFIG_BITS 63
  73. #define PERF_COUNTER_CONFIG_SHIFT 0
  74. #define PERF_COUNTER_CONFIG_MASK __PERF_COUNTER_MASK(CONFIG)
  75. #define PERF_COUNTER_TYPE_BITS 7
  76. #define PERF_COUNTER_TYPE_SHIFT 56
  77. #define PERF_COUNTER_TYPE_MASK __PERF_COUNTER_MASK(TYPE)
  78. #define PERF_COUNTER_EVENT_BITS 56
  79. #define PERF_COUNTER_EVENT_SHIFT 0
  80. #define PERF_COUNTER_EVENT_MASK __PERF_COUNTER_MASK(EVENT)
  81. /*
  82. * Bits that can be set in attr.sample_type to request information
  83. * in the overflow packets.
  84. */
  85. enum perf_counter_sample_format {
  86. PERF_SAMPLE_IP = 1U << 0,
  87. PERF_SAMPLE_TID = 1U << 1,
  88. PERF_SAMPLE_TIME = 1U << 2,
  89. PERF_SAMPLE_ADDR = 1U << 3,
  90. PERF_SAMPLE_GROUP = 1U << 4,
  91. PERF_SAMPLE_CALLCHAIN = 1U << 5,
  92. PERF_SAMPLE_CONFIG = 1U << 6,
  93. PERF_SAMPLE_CPU = 1U << 7,
  94. };
  95. /*
  96. * Bits that can be set in attr.read_format to request that
  97. * reads on the counter should return the indicated quantities,
  98. * in increasing order of bit value, after the counter value.
  99. */
  100. enum perf_counter_read_format {
  101. PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
  102. PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
  103. PERF_FORMAT_ID = 1U << 2,
  104. };
  105. /*
  106. * Hardware event to monitor via a performance monitoring counter:
  107. */
  108. struct perf_counter_attr {
  109. /*
  110. * The MSB of the config word signifies if the rest contains cpu
  111. * specific (raw) counter configuration data, if unset, the next
  112. * 7 bits are an event type and the rest of the bits are the event
  113. * identifier.
  114. */
  115. __u64 config;
  116. union {
  117. __u64 sample_period;
  118. __u64 sample_freq;
  119. };
  120. __u64 sample_type;
  121. __u64 read_format;
  122. __u64 disabled : 1, /* off by default */
  123. inherit : 1, /* children inherit it */
  124. pinned : 1, /* must always be on PMU */
  125. exclusive : 1, /* only group on PMU */
  126. exclude_user : 1, /* don't count user */
  127. exclude_kernel : 1, /* ditto kernel */
  128. exclude_hv : 1, /* ditto hypervisor */
  129. exclude_idle : 1, /* don't count when idle */
  130. mmap : 1, /* include mmap data */
  131. comm : 1, /* include comm data */
  132. freq : 1, /* use freq, not period */
  133. __reserved_1 : 53;
  134. __u32 wakeup_events; /* wakeup every n events */
  135. __u32 __reserved_2;
  136. __u64 __reserved_3;
  137. __u64 __reserved_4;
  138. };
  139. /*
  140. * Ioctls that can be done on a perf counter fd:
  141. */
  142. #define PERF_COUNTER_IOC_ENABLE _IO ('$', 0)
  143. #define PERF_COUNTER_IOC_DISABLE _IO ('$', 1)
  144. #define PERF_COUNTER_IOC_REFRESH _IO ('$', 2)
  145. #define PERF_COUNTER_IOC_RESET _IO ('$', 3)
  146. #define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64)
  147. enum perf_counter_ioc_flags {
  148. PERF_IOC_FLAG_GROUP = 1U << 0,
  149. };
  150. /*
  151. * Structure of the page that can be mapped via mmap
  152. */
  153. struct perf_counter_mmap_page {
  154. __u32 version; /* version number of this structure */
  155. __u32 compat_version; /* lowest version this is compat with */
  156. /*
  157. * Bits needed to read the hw counters in user-space.
  158. *
  159. * u32 seq;
  160. * s64 count;
  161. *
  162. * do {
  163. * seq = pc->lock;
  164. *
  165. * barrier()
  166. * if (pc->index) {
  167. * count = pmc_read(pc->index - 1);
  168. * count += pc->offset;
  169. * } else
  170. * goto regular_read;
  171. *
  172. * barrier();
  173. * } while (pc->lock != seq);
  174. *
  175. * NOTE: for obvious reason this only works on self-monitoring
  176. * processes.
  177. */
  178. __u32 lock; /* seqlock for synchronization */
  179. __u32 index; /* hardware counter identifier */
  180. __s64 offset; /* add to hardware counter value */
  181. /*
  182. * Control data for the mmap() data buffer.
  183. *
  184. * User-space reading this value should issue an rmb(), on SMP capable
  185. * platforms, after reading this value -- see perf_counter_wakeup().
  186. */
  187. __u64 data_head; /* head in the data section */
  188. };
  189. #define PERF_EVENT_MISC_CPUMODE_MASK (3 << 0)
  190. #define PERF_EVENT_MISC_CPUMODE_UNKNOWN (0 << 0)
  191. #define PERF_EVENT_MISC_KERNEL (1 << 0)
  192. #define PERF_EVENT_MISC_USER (2 << 0)
  193. #define PERF_EVENT_MISC_HYPERVISOR (3 << 0)
  194. #define PERF_EVENT_MISC_OVERFLOW (1 << 2)
  195. struct perf_event_header {
  196. __u32 type;
  197. __u16 misc;
  198. __u16 size;
  199. };
  200. enum perf_event_type {
  201. /*
  202. * The MMAP events record the PROT_EXEC mappings so that we can
  203. * correlate userspace IPs to code. They have the following structure:
  204. *
  205. * struct {
  206. * struct perf_event_header header;
  207. *
  208. * u32 pid, tid;
  209. * u64 addr;
  210. * u64 len;
  211. * u64 pgoff;
  212. * char filename[];
  213. * };
  214. */
  215. PERF_EVENT_MMAP = 1,
  216. /*
  217. * struct {
  218. * struct perf_event_header header;
  219. *
  220. * u32 pid, tid;
  221. * char comm[];
  222. * };
  223. */
  224. PERF_EVENT_COMM = 3,
  225. /*
  226. * struct {
  227. * struct perf_event_header header;
  228. * u64 time;
  229. * u64 sample_period;
  230. * };
  231. */
  232. PERF_EVENT_PERIOD = 4,
  233. /*
  234. * struct {
  235. * struct perf_event_header header;
  236. * u64 time;
  237. * };
  238. */
  239. PERF_EVENT_THROTTLE = 5,
  240. PERF_EVENT_UNTHROTTLE = 6,
  241. /*
  242. * struct {
  243. * struct perf_event_header header;
  244. * u32 pid, ppid;
  245. * };
  246. */
  247. PERF_EVENT_FORK = 7,
  248. /*
  249. * When header.misc & PERF_EVENT_MISC_OVERFLOW the event_type field
  250. * will be PERF_RECORD_*
  251. *
  252. * struct {
  253. * struct perf_event_header header;
  254. *
  255. * { u64 ip; } && PERF_RECORD_IP
  256. * { u32 pid, tid; } && PERF_RECORD_TID
  257. * { u64 time; } && PERF_RECORD_TIME
  258. * { u64 addr; } && PERF_RECORD_ADDR
  259. * { u64 config; } && PERF_RECORD_CONFIG
  260. * { u32 cpu, res; } && PERF_RECORD_CPU
  261. *
  262. * { u64 nr;
  263. * { u64 id, val; } cnt[nr]; } && PERF_RECORD_GROUP
  264. *
  265. * { u16 nr,
  266. * hv,
  267. * kernel,
  268. * user;
  269. * u64 ips[nr]; } && PERF_RECORD_CALLCHAIN
  270. * };
  271. */
  272. };
  273. #ifdef __KERNEL__
  274. /*
  275. * Kernel-internal data types and definitions:
  276. */
  277. #ifdef CONFIG_PERF_COUNTERS
  278. # include <asm/perf_counter.h>
  279. #endif
  280. #include <linux/list.h>
  281. #include <linux/mutex.h>
  282. #include <linux/rculist.h>
  283. #include <linux/rcupdate.h>
  284. #include <linux/spinlock.h>
  285. #include <linux/hrtimer.h>
  286. #include <linux/fs.h>
  287. #include <linux/pid_namespace.h>
  288. #include <asm/atomic.h>
  289. struct task_struct;
  290. static inline u64 perf_event_raw(struct perf_counter_attr *attr)
  291. {
  292. return attr->config & PERF_COUNTER_RAW_MASK;
  293. }
  294. static inline u64 perf_event_config(struct perf_counter_attr *attr)
  295. {
  296. return attr->config & PERF_COUNTER_CONFIG_MASK;
  297. }
  298. static inline u64 perf_event_type(struct perf_counter_attr *attr)
  299. {
  300. return (attr->config & PERF_COUNTER_TYPE_MASK) >>
  301. PERF_COUNTER_TYPE_SHIFT;
  302. }
  303. static inline u64 perf_event_id(struct perf_counter_attr *attr)
  304. {
  305. return attr->config & PERF_COUNTER_EVENT_MASK;
  306. }
  307. /**
  308. * struct hw_perf_counter - performance counter hardware details:
  309. */
  310. struct hw_perf_counter {
  311. #ifdef CONFIG_PERF_COUNTERS
  312. union {
  313. struct { /* hardware */
  314. u64 config;
  315. unsigned long config_base;
  316. unsigned long counter_base;
  317. int idx;
  318. };
  319. union { /* software */
  320. atomic64_t count;
  321. struct hrtimer hrtimer;
  322. };
  323. };
  324. atomic64_t prev_count;
  325. u64 sample_period;
  326. atomic64_t period_left;
  327. u64 interrupts;
  328. #endif
  329. };
  330. struct perf_counter;
  331. /**
  332. * struct pmu - generic performance monitoring unit
  333. */
  334. struct pmu {
  335. int (*enable) (struct perf_counter *counter);
  336. void (*disable) (struct perf_counter *counter);
  337. void (*read) (struct perf_counter *counter);
  338. void (*unthrottle) (struct perf_counter *counter);
  339. };
  340. /**
  341. * enum perf_counter_active_state - the states of a counter
  342. */
  343. enum perf_counter_active_state {
  344. PERF_COUNTER_STATE_ERROR = -2,
  345. PERF_COUNTER_STATE_OFF = -1,
  346. PERF_COUNTER_STATE_INACTIVE = 0,
  347. PERF_COUNTER_STATE_ACTIVE = 1,
  348. };
  349. struct file;
  350. struct perf_mmap_data {
  351. struct rcu_head rcu_head;
  352. int nr_pages; /* nr of data pages */
  353. int nr_locked; /* nr pages mlocked */
  354. atomic_t poll; /* POLL_ for wakeups */
  355. atomic_t events; /* event limit */
  356. atomic_long_t head; /* write position */
  357. atomic_long_t done_head; /* completed head */
  358. atomic_t lock; /* concurrent writes */
  359. atomic_t wakeup; /* needs a wakeup */
  360. struct perf_counter_mmap_page *user_page;
  361. void *data_pages[0];
  362. };
  363. struct perf_pending_entry {
  364. struct perf_pending_entry *next;
  365. void (*func)(struct perf_pending_entry *);
  366. };
  367. /**
  368. * struct perf_counter - performance counter kernel representation:
  369. */
  370. struct perf_counter {
  371. #ifdef CONFIG_PERF_COUNTERS
  372. struct list_head list_entry;
  373. struct list_head event_entry;
  374. struct list_head sibling_list;
  375. int nr_siblings;
  376. struct perf_counter *group_leader;
  377. const struct pmu *pmu;
  378. enum perf_counter_active_state state;
  379. atomic64_t count;
  380. /*
  381. * These are the total time in nanoseconds that the counter
  382. * has been enabled (i.e. eligible to run, and the task has
  383. * been scheduled in, if this is a per-task counter)
  384. * and running (scheduled onto the CPU), respectively.
  385. *
  386. * They are computed from tstamp_enabled, tstamp_running and
  387. * tstamp_stopped when the counter is in INACTIVE or ACTIVE state.
  388. */
  389. u64 total_time_enabled;
  390. u64 total_time_running;
  391. /*
  392. * These are timestamps used for computing total_time_enabled
  393. * and total_time_running when the counter is in INACTIVE or
  394. * ACTIVE state, measured in nanoseconds from an arbitrary point
  395. * in time.
  396. * tstamp_enabled: the notional time when the counter was enabled
  397. * tstamp_running: the notional time when the counter was scheduled on
  398. * tstamp_stopped: in INACTIVE state, the notional time when the
  399. * counter was scheduled off.
  400. */
  401. u64 tstamp_enabled;
  402. u64 tstamp_running;
  403. u64 tstamp_stopped;
  404. struct perf_counter_attr attr;
  405. struct hw_perf_counter hw;
  406. struct perf_counter_context *ctx;
  407. struct file *filp;
  408. /*
  409. * These accumulate total time (in nanoseconds) that children
  410. * counters have been enabled and running, respectively.
  411. */
  412. atomic64_t child_total_time_enabled;
  413. atomic64_t child_total_time_running;
  414. /*
  415. * Protect attach/detach and child_list:
  416. */
  417. struct mutex child_mutex;
  418. struct list_head child_list;
  419. struct perf_counter *parent;
  420. int oncpu;
  421. int cpu;
  422. struct list_head owner_entry;
  423. struct task_struct *owner;
  424. /* mmap bits */
  425. struct mutex mmap_mutex;
  426. atomic_t mmap_count;
  427. struct perf_mmap_data *data;
  428. /* poll related */
  429. wait_queue_head_t waitq;
  430. struct fasync_struct *fasync;
  431. /* delayed work for NMIs and such */
  432. int pending_wakeup;
  433. int pending_kill;
  434. int pending_disable;
  435. struct perf_pending_entry pending;
  436. atomic_t event_limit;
  437. void (*destroy)(struct perf_counter *);
  438. struct rcu_head rcu_head;
  439. struct pid_namespace *ns;
  440. u64 id;
  441. #endif
  442. };
  443. /**
  444. * struct perf_counter_context - counter context structure
  445. *
  446. * Used as a container for task counters and CPU counters as well:
  447. */
  448. struct perf_counter_context {
  449. /*
  450. * Protect the states of the counters in the list,
  451. * nr_active, and the list:
  452. */
  453. spinlock_t lock;
  454. /*
  455. * Protect the list of counters. Locking either mutex or lock
  456. * is sufficient to ensure the list doesn't change; to change
  457. * the list you need to lock both the mutex and the spinlock.
  458. */
  459. struct mutex mutex;
  460. struct list_head counter_list;
  461. struct list_head event_list;
  462. int nr_counters;
  463. int nr_active;
  464. int is_active;
  465. atomic_t refcount;
  466. struct task_struct *task;
  467. /*
  468. * Context clock, runs when context enabled.
  469. */
  470. u64 time;
  471. u64 timestamp;
  472. /*
  473. * These fields let us detect when two contexts have both
  474. * been cloned (inherited) from a common ancestor.
  475. */
  476. struct perf_counter_context *parent_ctx;
  477. u64 parent_gen;
  478. u64 generation;
  479. int pin_count;
  480. struct rcu_head rcu_head;
  481. };
  482. /**
  483. * struct perf_counter_cpu_context - per cpu counter context structure
  484. */
  485. struct perf_cpu_context {
  486. struct perf_counter_context ctx;
  487. struct perf_counter_context *task_ctx;
  488. int active_oncpu;
  489. int max_pertask;
  490. int exclusive;
  491. /*
  492. * Recursion avoidance:
  493. *
  494. * task, softirq, irq, nmi context
  495. */
  496. int recursion[4];
  497. };
  498. #ifdef CONFIG_PERF_COUNTERS
  499. /*
  500. * Set by architecture code:
  501. */
  502. extern int perf_max_counters;
  503. extern const struct pmu *hw_perf_counter_init(struct perf_counter *counter);
  504. extern void perf_counter_task_sched_in(struct task_struct *task, int cpu);
  505. extern void perf_counter_task_sched_out(struct task_struct *task,
  506. struct task_struct *next, int cpu);
  507. extern void perf_counter_task_tick(struct task_struct *task, int cpu);
  508. extern int perf_counter_init_task(struct task_struct *child);
  509. extern void perf_counter_exit_task(struct task_struct *child);
  510. extern void perf_counter_free_task(struct task_struct *task);
  511. extern void perf_counter_do_pending(void);
  512. extern void perf_counter_print_debug(void);
  513. extern void __perf_disable(void);
  514. extern bool __perf_enable(void);
  515. extern void perf_disable(void);
  516. extern void perf_enable(void);
  517. extern int perf_counter_task_disable(void);
  518. extern int perf_counter_task_enable(void);
  519. extern int hw_perf_group_sched_in(struct perf_counter *group_leader,
  520. struct perf_cpu_context *cpuctx,
  521. struct perf_counter_context *ctx, int cpu);
  522. extern void perf_counter_update_userpage(struct perf_counter *counter);
  523. extern int perf_counter_overflow(struct perf_counter *counter,
  524. int nmi, struct pt_regs *regs, u64 addr);
  525. /*
  526. * Return 1 for a software counter, 0 for a hardware counter
  527. */
  528. static inline int is_software_counter(struct perf_counter *counter)
  529. {
  530. return !perf_event_raw(&counter->attr) &&
  531. perf_event_type(&counter->attr) != PERF_TYPE_HARDWARE;
  532. }
  533. extern void perf_swcounter_event(u32, u64, int, struct pt_regs *, u64);
  534. extern void __perf_counter_mmap(struct vm_area_struct *vma);
  535. static inline void perf_counter_mmap(struct vm_area_struct *vma)
  536. {
  537. if (vma->vm_flags & VM_EXEC)
  538. __perf_counter_mmap(vma);
  539. }
  540. extern void perf_counter_comm(struct task_struct *tsk);
  541. extern void perf_counter_fork(struct task_struct *tsk);
  542. extern void perf_counter_task_migration(struct task_struct *task, int cpu);
  543. #define MAX_STACK_DEPTH 255
  544. struct perf_callchain_entry {
  545. u16 nr, hv, kernel, user;
  546. u64 ip[MAX_STACK_DEPTH];
  547. };
  548. extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs);
  549. extern int sysctl_perf_counter_priv;
  550. extern int sysctl_perf_counter_mlock;
  551. extern int sysctl_perf_counter_limit;
  552. extern void perf_counter_init(void);
  553. #ifndef perf_misc_flags
  554. #define perf_misc_flags(regs) (user_mode(regs) ? PERF_EVENT_MISC_USER : \
  555. PERF_EVENT_MISC_KERNEL)
  556. #define perf_instruction_pointer(regs) instruction_pointer(regs)
  557. #endif
  558. #else
  559. static inline void
  560. perf_counter_task_sched_in(struct task_struct *task, int cpu) { }
  561. static inline void
  562. perf_counter_task_sched_out(struct task_struct *task,
  563. struct task_struct *next, int cpu) { }
  564. static inline void
  565. perf_counter_task_tick(struct task_struct *task, int cpu) { }
  566. static inline int perf_counter_init_task(struct task_struct *child) { return 0; }
  567. static inline void perf_counter_exit_task(struct task_struct *child) { }
  568. static inline void perf_counter_free_task(struct task_struct *task) { }
  569. static inline void perf_counter_do_pending(void) { }
  570. static inline void perf_counter_print_debug(void) { }
  571. static inline void perf_disable(void) { }
  572. static inline void perf_enable(void) { }
  573. static inline int perf_counter_task_disable(void) { return -EINVAL; }
  574. static inline int perf_counter_task_enable(void) { return -EINVAL; }
  575. static inline void
  576. perf_swcounter_event(u32 event, u64 nr, int nmi,
  577. struct pt_regs *regs, u64 addr) { }
  578. static inline void perf_counter_mmap(struct vm_area_struct *vma) { }
  579. static inline void perf_counter_comm(struct task_struct *tsk) { }
  580. static inline void perf_counter_fork(struct task_struct *tsk) { }
  581. static inline void perf_counter_init(void) { }
  582. static inline void perf_counter_task_migration(struct task_struct *task,
  583. int cpu) { }
  584. #endif
  585. #endif /* __KERNEL__ */
  586. #endif /* _LINUX_PERF_COUNTER_H */