aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/parse-events.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-04-19 05:52:53 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:17:58 -0400
commit9beeaa2d689842f7760aa16c512e6bb8182d38b6 (patch)
tree62cea0772127c4b1c0b476e46dec6830d36809c1 /tools/perf/util/parse-events.c
parent3246af0ece6c61689847417977733f0b12dc4b6f (diff)
parenta1645ce12adb6c9cc9e19d7695466204e3f017fe (diff)
Merge branch 'perf'
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r--tools/perf/util/parse-events.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 05d0c5c2030c..3b4ec6797565 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -5,6 +5,7 @@
5#include "parse-events.h" 5#include "parse-events.h"
6#include "exec_cmd.h" 6#include "exec_cmd.h"
7#include "string.h" 7#include "string.h"
8#include "symbol.h"
8#include "cache.h" 9#include "cache.h"
9#include "header.h" 10#include "header.h"
10#include "debugfs.h" 11#include "debugfs.h"
@@ -409,7 +410,6 @@ static enum event_result
409parse_single_tracepoint_event(char *sys_name, 410parse_single_tracepoint_event(char *sys_name,
410 const char *evt_name, 411 const char *evt_name,
411 unsigned int evt_length, 412 unsigned int evt_length,
412 char *flags,
413 struct perf_event_attr *attr, 413 struct perf_event_attr *attr,
414 const char **strp) 414 const char **strp)
415{ 415{
@@ -418,13 +418,11 @@ parse_single_tracepoint_event(char *sys_name,
418 u64 id; 418 u64 id;
419 int fd; 419 int fd;
420 420
421 if (flags) { 421 attr->sample_type |= PERF_SAMPLE_RAW;
422 if (!strncmp(flags, "record", strlen(flags))) { 422 attr->sample_type |= PERF_SAMPLE_TIME;
423 attr->sample_type |= PERF_SAMPLE_RAW; 423 attr->sample_type |= PERF_SAMPLE_CPU;
424 attr->sample_type |= PERF_SAMPLE_TIME; 424
425 attr->sample_type |= PERF_SAMPLE_CPU; 425 attr->sample_period = 1;
426 }
427 }
428 426
429 snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path, 427 snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path,
430 sys_name, evt_name); 428 sys_name, evt_name);
@@ -532,8 +530,7 @@ static enum event_result parse_tracepoint_event(const char **strp,
532 flags); 530 flags);
533 } else 531 } else
534 return parse_single_tracepoint_event(sys_name, evt_name, 532 return parse_single_tracepoint_event(sys_name, evt_name,
535 evt_length, flags, 533 evt_length, attr, strp);
536 attr, strp);
537} 534}
538 535
539static enum event_result 536static enum event_result
@@ -656,6 +653,10 @@ parse_raw_event(const char **strp, struct perf_event_attr *attr)
656 return EVT_FAILED; 653 return EVT_FAILED;
657 n = hex2u64(str + 1, &config); 654 n = hex2u64(str + 1, &config);
658 if (n > 0) { 655 if (n > 0) {
656 if (str[n+1] == 'p') {
657 attr->precise = 1;
658 n++;
659 }
659 *strp = str + n + 1; 660 *strp = str + n + 1;
660 attr->type = PERF_TYPE_RAW; 661 attr->type = PERF_TYPE_RAW;
661 attr->config = config; 662 attr->config = config;