mirror of https://github.com/mkerrisk/man-pages
perf_event_open.2: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the following way: - Use the name of the variable instead of its type as argument for ``sizeof``. Rationale: https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
aff660d379
commit
3376a63838
|
@ -3419,9 +3419,9 @@ main(int argc, char **argv)
|
|||
long long count;
|
||||
int fd;
|
||||
|
||||
memset(&pe, 0, sizeof(struct perf_event_attr));
|
||||
memset(&pe, 0, sizeof(pe));
|
||||
pe.type = PERF_TYPE_HARDWARE;
|
||||
pe.size = sizeof(struct perf_event_attr);
|
||||
pe.size = sizeof(pe);
|
||||
pe.config = PERF_COUNT_HW_INSTRUCTIONS;
|
||||
pe.disabled = 1;
|
||||
pe.exclude_kernel = 1;
|
||||
|
|
Loading…
Reference in New Issue