Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199739
b: refs/heads/master
c: da3fd1a
h: refs/heads/master
i:
  199737: a2fcada
  199735: 75e02c6
v: v3
  • Loading branch information
Ingo Molnar committed Jun 2, 2010
1 parent eedfbb5 commit 3111e78
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 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: b5c874f14c5f57cc8654e9184694196c466147bb
refs/heads/master: da3fd1a0010ccc9fe6fd5ae2b9e85e1aacc03e4d
3 changes: 1 addition & 2 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ static int __cmd_record(int argc, const char **argv)
{
int i, counter;
struct stat st;
pid_t pid = 0;
int flags;
int err;
unsigned long waking = 0;
Expand Down Expand Up @@ -572,7 +571,7 @@ static int __cmd_record(int argc, const char **argv)

if (forks) {
child_pid = fork();
if (pid < 0) {
if (child_pid < 0) {
perror("failed to fork");
exit(-1);
}
Expand Down
1 change: 1 addition & 0 deletions trunk/tools/perf/builtin-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,7 @@ static struct perf_event_ops event_ops = {
.sample = process_sample_event,
.comm = event__process_comm,
.lost = event__process_lost,
.fork = event__process_task,
.ordered_samples = true,
};

Expand Down
13 changes: 4 additions & 9 deletions trunk/tools/perf/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ static int thread__set_comm_adjust(struct thread *self, const char *comm)

int event__process_comm(event_t *self, struct perf_session *session)
{
struct thread *thread = perf_session__findnew(session, self->comm.pid);
struct thread *thread = perf_session__findnew(session, self->comm.tid);

dump_printf(": %s:%d\n", self->comm.comm, self->comm.pid);
dump_printf(": %s:%d\n", self->comm.comm, self->comm.tid);

if (thread == NULL || thread__set_comm_adjust(thread, self->comm.comm)) {
dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n");
Expand Down Expand Up @@ -532,16 +532,11 @@ int event__process_mmap(event_t *self, struct perf_session *session)

int event__process_task(event_t *self, struct perf_session *session)
{
struct thread *thread = perf_session__findnew(session, self->fork.pid);
struct thread *parent = perf_session__findnew(session, self->fork.ppid);
struct thread *thread = perf_session__findnew(session, self->fork.tid);
struct thread *parent = perf_session__findnew(session, self->fork.ptid);

dump_printf("(%d:%d):(%d:%d)\n", self->fork.pid, self->fork.tid,
self->fork.ppid, self->fork.ptid);
/*
* A thread clone will have the same PID for both parent and child.
*/
if (thread == parent)
return 0;

if (self->header.type == PERF_RECORD_EXIT)
return 0;
Expand Down

0 comments on commit 3111e78

Please sign in to comment.