Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147297
b: refs/heads/master
c: ea5d20c
h: refs/heads/master
i:
  147295: 3f219f9
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 6, 2009
1 parent fcae53f commit da5740b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 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: 63e35b25d6b5c3136d22ef249dbbf96716aa08bf
refs/heads/master: ea5d20cf99db5d26d43b6d322d3ace17e08a6552
5 changes: 4 additions & 1 deletion trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ struct perf_counter_hw_event {
exclude_kernel : 1, /* ditto kernel */
exclude_hv : 1, /* ditto hypervisor */
exclude_idle : 1, /* don't count when idle */
include_tid : 1, /* include the tid */

__reserved_1 : 55;
__reserved_1 : 54;

__u32 extra_config_len;
__u32 __reserved_4;
Expand Down Expand Up @@ -164,6 +165,8 @@ struct perf_event_header {
enum perf_event_type {
PERF_EVENT_IP = 0,
PERF_EVENT_GROUP = 1,

__PERF_EVENT_TID = 0x100,
};

#ifdef __KERNEL__
Expand Down
18 changes: 16 additions & 2 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1528,16 +1528,30 @@ static int perf_output_write(struct perf_counter *counter, int nmi,
static void perf_output_simple(struct perf_counter *counter,
int nmi, struct pt_regs *regs)
{
unsigned int size;
struct {
struct perf_event_header header;
u64 ip;
u32 pid, tid;
} event;

event.header.type = PERF_EVENT_IP;
event.header.size = sizeof(event);
event.ip = instruction_pointer(regs);

perf_output_write(counter, nmi, &event, sizeof(event));
size = sizeof(event);

if (counter->hw_event.include_tid) {
/* namespace issues */
event.pid = current->group_leader->pid;
event.tid = current->pid;

event.header.type |= __PERF_EVENT_TID;
} else
size -= sizeof(u64);

event.header.size = size;

perf_output_write(counter, nmi, &event, size);
}

static void perf_output_group(struct perf_counter *counter, int nmi)
Expand Down

0 comments on commit da5740b

Please sign in to comment.