Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147352
b: refs/heads/master
c: 4d85545
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 8, 2009
1 parent 97e12fe commit 4fa0c54
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: de9ac07bbf8f51e0ce40e5428c3a8f627bd237c2
refs/heads/master: 4d855457d84b819fefcd1cd1b0a2a0a0ec475c07
9 changes: 4 additions & 5 deletions trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ enum sw_event_ids {
enum perf_counter_record_format {
PERF_RECORD_IP = 1U << 0,
PERF_RECORD_TID = 1U << 1,
PERF_RECORD_GROUP = 1U << 2,
PERF_RECORD_CALLCHAIN = 1U << 3,
PERF_RECORD_TIME = 1U << 4,
PERF_RECORD_TIME = 1U << 2,
PERF_RECORD_GROUP = 1U << 3,
PERF_RECORD_CALLCHAIN = 1U << 4,
};

/*
Expand Down Expand Up @@ -250,6 +250,7 @@ enum perf_event_type {
*
* { u64 ip; } && PERF_RECORD_IP
* { u32 pid, tid; } && PERF_RECORD_TID
* { u64 time; } && PERF_RECORD_TIME
*
* { u64 nr;
* { u64 event, val; } cnt[nr]; } && PERF_RECORD_GROUP
Expand All @@ -259,8 +260,6 @@ enum perf_event_type {
* kernel,
* user;
* u64 ips[nr]; } && PERF_RECORD_CALLCHAIN
*
* { u64 time; } && PERF_RECORD_TIME
* };
*/
};
Expand Down
26 changes: 13 additions & 13 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,16 @@ static void perf_counter_output(struct perf_counter *counter,
header.size += sizeof(tid_entry);
}

if (record_type & PERF_RECORD_TIME) {
/*
* Maybe do better on x86 and provide cpu_clock_nmi()
*/
time = sched_clock();

header.type |= PERF_RECORD_TIME;
header.size += sizeof(u64);
}

if (record_type & PERF_RECORD_GROUP) {
header.type |= PERF_RECORD_GROUP;
header.size += sizeof(u64) +
Expand All @@ -1867,16 +1877,6 @@ static void perf_counter_output(struct perf_counter *counter,
}
}

if (record_type & PERF_RECORD_TIME) {
/*
* Maybe do better on x86 and provide cpu_clock_nmi()
*/
time = sched_clock();

header.type |= PERF_RECORD_TIME;
header.size += sizeof(u64);
}

ret = perf_output_begin(&handle, counter, header.size, nmi, 1);
if (ret)
return;
Expand All @@ -1889,6 +1889,9 @@ static void perf_counter_output(struct perf_counter *counter,
if (record_type & PERF_RECORD_TID)
perf_output_put(&handle, tid_entry);

if (record_type & PERF_RECORD_TIME)
perf_output_put(&handle, time);

if (record_type & PERF_RECORD_GROUP) {
struct perf_counter *leader, *sub;
u64 nr = counter->nr_siblings;
Expand All @@ -1910,9 +1913,6 @@ static void perf_counter_output(struct perf_counter *counter,
if (callchain)
perf_output_copy(&handle, callchain, callchain_size);

if (record_type & PERF_RECORD_TIME)
perf_output_put(&handle, time);

perf_output_end(&handle);
}

Expand Down

0 comments on commit 4fa0c54

Please sign in to comment.