Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199736
b: refs/heads/master
c: 75d9ef1
h: refs/heads/master
v: v3
  • Loading branch information
Konstantin Stepanyuk authored and Arnaldo Carvalho de Melo committed Jun 1, 2010
1 parent 75e02c6 commit 3c9ef15
Show file tree
Hide file tree
Showing 5 changed files with 13 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: 2fb750e825b5347de0390315f4284f13709a9856
refs/heads/master: 75d9ef1707cf3db264a549142a1f54a5380d63dc
3 changes: 2 additions & 1 deletion trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ 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 @@ -571,7 +572,7 @@ static int __cmd_record(int argc, const char **argv)

if (forks) {
child_pid = fork();
if (child_pid < 0) {
if (pid < 0) {
perror("failed to fork");
exit(-1);
}
Expand Down
1 change: 0 additions & 1 deletion trunk/tools/perf/builtin-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,6 @@ 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: 9 additions & 4 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.tid);
struct thread *thread = perf_session__findnew(session, self->comm.pid);

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

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,11 +532,16 @@ 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.tid);
struct thread *parent = perf_session__findnew(session, self->fork.ptid);
struct thread *thread = perf_session__findnew(session, self->fork.pid);
struct thread *parent = perf_session__findnew(session, self->fork.ppid);

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
2 changes: 1 addition & 1 deletion trunk/tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file,
* Parse hexa addresses followed by ':'
*/
line_ip = strtoull(tmp, &tmp2, 16);
if (*tmp2 != ':')
if (*tmp2 != ':' || tmp == tmp2)
line_ip = -1;
}

Expand Down

0 comments on commit 3c9ef15

Please sign in to comment.