Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147674
b: refs/heads/master
c: 689802b
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Jun 5, 2009
1 parent 8d086a4 commit 374aa1c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac4bcf889469ffbca88f234d3184452886a47905
refs/heads/master: 689802b2d0536e72281dc959ab9cb34fb3c304cf
2 changes: 2 additions & 0 deletions trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ enum perf_counter_sample_format {
PERF_SAMPLE_CALLCHAIN = 1U << 5,
PERF_SAMPLE_ID = 1U << 6,
PERF_SAMPLE_CPU = 1U << 7,
PERF_SAMPLE_PERIOD = 1U << 8,
};

/*
Expand Down Expand Up @@ -260,6 +261,7 @@ enum perf_event_type {
* struct {
* struct perf_event_header header;
* u64 time;
* u64 id;
* u64 sample_period;
* };
*/
Expand Down
10 changes: 10 additions & 0 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -2404,6 +2404,11 @@ static void perf_counter_output(struct perf_counter *counter,
cpu_entry.cpu = raw_smp_processor_id();
}

if (sample_type & PERF_SAMPLE_PERIOD) {
header.type |= PERF_SAMPLE_PERIOD;
header.size += sizeof(u64);
}

if (sample_type & PERF_SAMPLE_GROUP) {
header.type |= PERF_SAMPLE_GROUP;
header.size += sizeof(u64) +
Expand Down Expand Up @@ -2445,6 +2450,9 @@ static void perf_counter_output(struct perf_counter *counter,
if (sample_type & PERF_SAMPLE_CPU)
perf_output_put(&handle, cpu_entry);

if (sample_type & PERF_SAMPLE_PERIOD)
perf_output_put(&handle, counter->hw.sample_period);

/*
* XXX PERF_SAMPLE_GROUP vs inherited counters seems difficult.
*/
Expand Down Expand Up @@ -2835,6 +2843,7 @@ static void perf_log_period(struct perf_counter *counter, u64 period)
struct {
struct perf_event_header header;
u64 time;
u64 id;
u64 period;
} freq_event = {
.header = {
Expand All @@ -2843,6 +2852,7 @@ static void perf_log_period(struct perf_counter *counter, u64 period)
.size = sizeof(freq_event),
},
.time = sched_clock(),
.id = counter->id,
.period = period,
};

Expand Down

0 comments on commit 374aa1c

Please sign in to comment.