perf_counter.h 17 KB

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