~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/util/events_stats.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __PERF_EVENTS_STATS_
  3 #define __PERF_EVENTS_STATS_
  4 
  5 #include <stdio.h>
  6 #include <perf/event.h>
  7 #include <linux/types.h>
  8 #include "auxtrace.h"
  9 
 10 /*
 11  * The kernel collects the number of events it couldn't send in a stretch and
 12  * when possible sends this number in a PERF_RECORD_LOST event. The number of
 13  * such "chunks" of lost events is stored in .nr_events[PERF_EVENT_LOST] while
 14  * total_lost tells exactly how many events the kernel in fact lost, i.e. it is
 15  * the sum of all struct perf_record_lost.lost fields reported.
 16  *
 17  * The kernel discards mixed up samples and sends the number in a
 18  * PERF_RECORD_LOST_SAMPLES event. The number of lost-samples events is stored
 19  * in .nr_events[PERF_RECORD_LOST_SAMPLES] while total_lost_samples tells
 20  * exactly how many samples the kernel in fact dropped, i.e. it is the sum of
 21  * all struct perf_record_lost_samples.lost fields reported.
 22  *
 23  * The total_period is needed because by default auto-freq is used, so
 24  * multiplying nr_events[PERF_EVENT_SAMPLE] by a frequency isn't possible to get
 25  * the total number of low level events, it is necessary to sum all struct
 26  * perf_record_sample.period and stash the result in total_period.
 27  */
 28 struct events_stats {
 29         u64 total_lost;
 30         u64 total_lost_samples;
 31         u64 total_aux_lost;
 32         u64 total_aux_partial;
 33         u64 total_aux_collision;
 34         u64 total_invalid_chains;
 35         u32 nr_events[PERF_RECORD_HEADER_MAX];
 36         u32 nr_lost_warned;
 37         u32 nr_unknown_events;
 38         u32 nr_invalid_chains;
 39         u32 nr_unknown_id;
 40         u32 nr_unprocessable_samples;
 41         u32 nr_auxtrace_errors[PERF_AUXTRACE_ERROR_MAX];
 42         u32 nr_proc_map_timeout;
 43 };
 44 
 45 struct hists_stats {
 46         u64 total_period;
 47         u64 total_non_filtered_period;
 48         u32 nr_samples;
 49         u32 nr_non_filtered_samples;
 50         u32 nr_lost_samples;
 51 };
 52 
 53 void events_stats__inc(struct events_stats *stats, u32 type);
 54 
 55 size_t events_stats__fprintf(struct events_stats *stats, FILE *fp);
 56 
 57 #endif /* __PERF_EVENTS_STATS_ */
 58 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php