Skip to contentSkip to conversation

perf record: Set frequency correctly

tip:perfcounters/core tip-bot for Ingo Molnar 1 participant 1 message Jun 5, 2009 Documentation

lore
Share & tools
lore
#0 lore raw
Commit-ID:  1dba15e74aba5a90c1f2557f37e5d09f8a2df643
Gitweb:     http://git.kernel.org/tip/1dba15e74aba5a90c1f2557f37e5d09f8a2df643
Author:     Ingo Molnar <[email protected]>
AuthorDate: Fri, 5 Jun 2009 18:37:22 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 5 Jun 2009 18:37:22 +0200

perf record: Set frequency correctly

Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
LKML-Reference: <new-submission>

---
 Documentation/perf_counter/builtin-record.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
Documentation/perf_counter/builtin-record.c +4 -5
index 43ddab3..c22ea0c 100644
@@ -348,7 +348,10 @@ static void create_counter(int counter, int cpu, pid_t pid)
 	attr.config		= event_id[counter];
 	attr.sample_period	= event_count[counter];
 	attr.sample_type	= PERF_SAMPLE_IP | PERF_SAMPLE_TID | PERF_SAMPLE_PERIOD;
-	attr.freq		= freq;
+	if (freq) {
+		attr.freq		= 1;
+		attr.sample_freq	= freq;
+	}
 	attr.mmap		= track;
 	attr.comm		= track;
 	attr.inherit		= (cpu < 0) && inherit;
@@ -544,10 +547,6 @@ int cmd_record(int argc, const char **argv, const char *prefix)
 		event_id[0] = 0;
 	}
 
-	if (freq) {
-		default_interval = freq;
-		freq = 1;
-	}
 	for (counter = 0; counter < nr_counters; counter++) {
 		if (event_count[counter])
 			continue;