static int nr_cpus = 0;
static unsigned int page_size;
static unsigned int mmap_pages = 128;
+static int freq = 0;
static int output;
static const char *output_name = "perf.data";
static int group = 0;
attr.config = event_id[counter];
attr.sample_period = event_count[counter];
attr.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID;
+ attr.freq = freq;
attr.mmap = track;
attr.comm = track;
- attr.inherit = (cpu < 0) && inherit;
+ attr.inherit = (cpu < 0) && inherit;
track = 0; /* only the first counter needs these */
"output file name"),
OPT_BOOLEAN('i', "inherit", &inherit,
"child tasks inherit counters"),
+ OPT_INTEGER('F', "freq", &freq,
+ "profile at this frequency"),
OPT_INTEGER('m', "mmap-pages", &mmap_pages,
"number of mmap data pages"),
OPT_END()
event_id[0] = 0;
}
+ if (freq) {
+ default_interval = freq;
+ freq = 1;
+ }
for (counter = 0; counter < nr_counters; counter++) {
if (event_count[counter])
continue;
static unsigned int realtime_prio = 0;
static int group = 0;
static unsigned int page_size;
-static unsigned int mmap_pages = 16;
-static int freq = 0;
+static unsigned int mmap_pages = 16;
+static int freq = 0;
static char *sym_filter;
static unsigned long filter_start;
events_per_sec,
100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec)));
- if (nr_counters == 1)
- printf("%d ", event_count[0]);
+ if (nr_counters == 1) {
+ printf("%d", event_count[0]);
+ if (freq)
+ printf("Hz ");
+ else
+ printf(" ");
+ }
for (counter = 0; counter < nr_counters; counter++) {
if (counter)