Skip to content

Commit b438b1a

Browse files
amlutoIngo Molnar
authored andcommitted
perf: Fix typos in sample code in the perf_event.h header
struct perf_event_mmap_page has members called "index" and "cap_user_rdpmc". Spell them correctly in the examples. Signed-off-by: Andy Lutomirski <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/320ba26391a8123cc16e5f02d24d34bd404332fd.1412313343.git.luto@amacapital.net Signed-off-by: Ingo Molnar <[email protected]>
1 parent c719f56 commit b438b1a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

include/uapi/linux/perf_event.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ struct perf_event_mmap_page {
364364
/*
365365
* Bits needed to read the hw events in user-space.
366366
*
367-
* u32 seq, time_mult, time_shift, idx, width;
367+
* u32 seq, time_mult, time_shift, index, width;
368368
* u64 count, enabled, running;
369369
* u64 cyc, time_offset;
370370
* s64 pmc = 0;
@@ -383,11 +383,11 @@ struct perf_event_mmap_page {
383383
* time_shift = pc->time_shift;
384384
* }
385385
*
386-
* idx = pc->index;
386+
* index = pc->index;
387387
* count = pc->offset;
388-
* if (pc->cap_usr_rdpmc && idx) {
388+
* if (pc->cap_user_rdpmc && index) {
389389
* width = pc->pmc_width;
390-
* pmc = rdpmc(idx - 1);
390+
* pmc = rdpmc(index - 1);
391391
* }
392392
*
393393
* barrier();
@@ -415,7 +415,7 @@ struct perf_event_mmap_page {
415415
};
416416

417417
/*
418-
* If cap_usr_rdpmc this field provides the bit-width of the value
418+
* If cap_user_rdpmc this field provides the bit-width of the value
419419
* read using the rdpmc() or equivalent instruction. This can be used
420420
* to sign extend the result like:
421421
*
@@ -439,10 +439,10 @@ struct perf_event_mmap_page {
439439
*
440440
* Where time_offset,time_mult,time_shift and cyc are read in the
441441
* seqcount loop described above. This delta can then be added to
442-
* enabled and possible running (if idx), improving the scaling:
442+
* enabled and possible running (if index), improving the scaling:
443443
*
444444
* enabled += delta;
445-
* if (idx)
445+
* if (index)
446446
* running += delta;
447447
*
448448
* quot = count / running;

0 commit comments

Comments
 (0)