Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156637
b: refs/heads/master
c: a044560
h: refs/heads/master
i:
  156635: 0d9f874
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Aug 10, 2009
1 parent 8de4354 commit d2dd6f9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 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: c0a8865e32c8d1a562db38e06ef31ef23282f646
refs/heads/master: a044560c3a1f0ad75ce685c1ed7604820b9ed319
2 changes: 2 additions & 0 deletions trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ enum perf_event_type {
*
* { u64 nr,
* u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN
* { u32 size;
* char data[size];}&& PERF_SAMPLE_RAW
* };
*/
PERF_EVENT_SAMPLE = 9,
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/trace/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,8 @@ static void ftrace_profile_##call(proto) \
pc = preempt_count(); \
\
__data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
__entry_size = ALIGN(__data_size + sizeof(*entry), sizeof(u64));\
__entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\
sizeof(u64)); \
\
do { \
char raw_data[__entry_size]; \
Expand Down
30 changes: 24 additions & 6 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -2646,7 +2646,6 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
u64 counter;
} group_entry;
struct perf_callchain_entry *callchain = NULL;
struct perf_raw_record *raw = NULL;
int callchain_size = 0;
u64 time;
struct {
Expand Down Expand Up @@ -2716,9 +2715,15 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
}

if (sample_type & PERF_SAMPLE_RAW) {
raw = data->raw;
if (raw)
header.size += raw->size;
int size = sizeof(u32);

if (data->raw)
size += data->raw->size;
else
size += sizeof(u32);

WARN_ON_ONCE(size & (sizeof(u64)-1));
header.size += size;
}

ret = perf_output_begin(&handle, counter, header.size, nmi, 1);
Expand Down Expand Up @@ -2784,8 +2789,21 @@ static void perf_counter_output(struct perf_counter *counter, int nmi,
}
}

if ((sample_type & PERF_SAMPLE_RAW) && raw)
perf_output_copy(&handle, raw->data, raw->size);
if (sample_type & PERF_SAMPLE_RAW) {
if (data->raw) {
perf_output_put(&handle, data->raw->size);
perf_output_copy(&handle, data->raw->data, data->raw->size);
} else {
struct {
u32 size;
u32 data;
} raw = {
.size = sizeof(u32),
.data = 0,
};
perf_output_put(&handle, raw);
}
}

perf_output_end(&handle);
}
Expand Down

0 comments on commit d2dd6f9

Please sign in to comment.