diff options
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r-- | kernel/perf_counter.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 7669afe82cc7..f3e1b27bc1b8 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -1528,16 +1528,30 @@ out: | |||
1528 | static void perf_output_simple(struct perf_counter *counter, | 1528 | static void perf_output_simple(struct perf_counter *counter, |
1529 | int nmi, struct pt_regs *regs) | 1529 | int nmi, struct pt_regs *regs) |
1530 | { | 1530 | { |
1531 | unsigned int size; | ||
1531 | struct { | 1532 | struct { |
1532 | struct perf_event_header header; | 1533 | struct perf_event_header header; |
1533 | u64 ip; | 1534 | u64 ip; |
1535 | u32 pid, tid; | ||
1534 | } event; | 1536 | } event; |
1535 | 1537 | ||
1536 | event.header.type = PERF_EVENT_IP; | 1538 | event.header.type = PERF_EVENT_IP; |
1537 | event.header.size = sizeof(event); | ||
1538 | event.ip = instruction_pointer(regs); | 1539 | event.ip = instruction_pointer(regs); |
1539 | 1540 | ||
1540 | perf_output_write(counter, nmi, &event, sizeof(event)); | 1541 | size = sizeof(event); |
1542 | |||
1543 | if (counter->hw_event.include_tid) { | ||
1544 | /* namespace issues */ | ||
1545 | event.pid = current->group_leader->pid; | ||
1546 | event.tid = current->pid; | ||
1547 | |||
1548 | event.header.type |= __PERF_EVENT_TID; | ||
1549 | } else | ||
1550 | size -= sizeof(u64); | ||
1551 | |||
1552 | event.header.size = size; | ||
1553 | |||
1554 | perf_output_write(counter, nmi, &event, size); | ||
1541 | } | 1555 | } |
1542 | 1556 | ||
1543 | static void perf_output_group(struct perf_counter *counter, int nmi) | 1557 | static void perf_output_group(struct perf_counter *counter, int nmi) |