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 <luto@amacapital.net> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: linux-api@vger.kernel.org Link: http://lkml.kernel.org/r/320ba26391a8123cc16e5f02d24d34bd404332fd.1412313343.git.luto@amacapital.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
c719f56092
commit
b438b1ab35
@@ -364,7 +364,7 @@ struct perf_event_mmap_page {
|
|||||||
/*
|
/*
|
||||||
* Bits needed to read the hw events in user-space.
|
* Bits needed to read the hw events in user-space.
|
||||||
*
|
*
|
||||||
* u32 seq, time_mult, time_shift, idx, width;
|
* u32 seq, time_mult, time_shift, index, width;
|
||||||
* u64 count, enabled, running;
|
* u64 count, enabled, running;
|
||||||
* u64 cyc, time_offset;
|
* u64 cyc, time_offset;
|
||||||
* s64 pmc = 0;
|
* s64 pmc = 0;
|
||||||
@@ -383,11 +383,11 @@ struct perf_event_mmap_page {
|
|||||||
* time_shift = pc->time_shift;
|
* time_shift = pc->time_shift;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* idx = pc->index;
|
* index = pc->index;
|
||||||
* count = pc->offset;
|
* count = pc->offset;
|
||||||
* if (pc->cap_usr_rdpmc && idx) {
|
* if (pc->cap_user_rdpmc && index) {
|
||||||
* width = pc->pmc_width;
|
* width = pc->pmc_width;
|
||||||
* pmc = rdpmc(idx - 1);
|
* pmc = rdpmc(index - 1);
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* barrier();
|
* barrier();
|
||||||
@@ -415,7 +415,7 @@ struct perf_event_mmap_page {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If cap_usr_rdpmc this field provides the bit-width of the value
|
* If cap_user_rdpmc this field provides the bit-width of the value
|
||||||
* read using the rdpmc() or equivalent instruction. This can be used
|
* read using the rdpmc() or equivalent instruction. This can be used
|
||||||
* to sign extend the result like:
|
* to sign extend the result like:
|
||||||
*
|
*
|
||||||
@@ -439,10 +439,10 @@ struct perf_event_mmap_page {
|
|||||||
*
|
*
|
||||||
* Where time_offset,time_mult,time_shift and cyc are read in the
|
* Where time_offset,time_mult,time_shift and cyc are read in the
|
||||||
* seqcount loop described above. This delta can then be added to
|
* seqcount loop described above. This delta can then be added to
|
||||||
* enabled and possible running (if idx), improving the scaling:
|
* enabled and possible running (if index), improving the scaling:
|
||||||
*
|
*
|
||||||
* enabled += delta;
|
* enabled += delta;
|
||||||
* if (idx)
|
* if (index)
|
||||||
* running += delta;
|
* running += delta;
|
||||||
*
|
*
|
||||||
* quot = count / running;
|
* quot = count / running;
|
||||||
|
Reference in New Issue
Block a user