|
@@ -661,7 +661,7 @@ static int process_comm_event(struct perf_tool *tool,
|
|
struct thread *thread;
|
|
struct thread *thread;
|
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
|
struct perf_session *session = script->session;
|
|
struct perf_session *session = script->session;
|
|
- struct perf_evsel *evsel = perf_evlist__first(session->evlist);
|
|
|
|
|
|
+ struct perf_evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
|
|
int ret = -1;
|
|
int ret = -1;
|
|
|
|
|
|
thread = machine__findnew_thread(machine, event->comm.pid, event->comm.tid);
|
|
thread = machine__findnew_thread(machine, event->comm.pid, event->comm.tid);
|
|
@@ -695,7 +695,7 @@ static int process_fork_event(struct perf_tool *tool,
|
|
struct thread *thread;
|
|
struct thread *thread;
|
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
|
struct perf_session *session = script->session;
|
|
struct perf_session *session = script->session;
|
|
- struct perf_evsel *evsel = perf_evlist__first(session->evlist);
|
|
|
|
|
|
+ struct perf_evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
|
|
|
|
|
|
if (perf_event__process_fork(tool, event, sample, machine) < 0)
|
|
if (perf_event__process_fork(tool, event, sample, machine) < 0)
|
|
return -1;
|
|
return -1;
|
|
@@ -727,7 +727,7 @@ static int process_exit_event(struct perf_tool *tool,
|
|
struct thread *thread;
|
|
struct thread *thread;
|
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
|
struct perf_session *session = script->session;
|
|
struct perf_session *session = script->session;
|
|
- struct perf_evsel *evsel = perf_evlist__first(session->evlist);
|
|
|
|
|
|
+ struct perf_evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
|
|
|
|
|
|
thread = machine__findnew_thread(machine, event->fork.pid, event->fork.tid);
|
|
thread = machine__findnew_thread(machine, event->fork.pid, event->fork.tid);
|
|
if (thread == NULL) {
|
|
if (thread == NULL) {
|
|
@@ -759,7 +759,7 @@ static int process_mmap_event(struct perf_tool *tool,
|
|
struct thread *thread;
|
|
struct thread *thread;
|
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
|
struct perf_session *session = script->session;
|
|
struct perf_session *session = script->session;
|
|
- struct perf_evsel *evsel = perf_evlist__first(session->evlist);
|
|
|
|
|
|
+ struct perf_evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
|
|
|
|
|
|
if (perf_event__process_mmap(tool, event, sample, machine) < 0)
|
|
if (perf_event__process_mmap(tool, event, sample, machine) < 0)
|
|
return -1;
|
|
return -1;
|
|
@@ -790,7 +790,7 @@ static int process_mmap2_event(struct perf_tool *tool,
|
|
struct thread *thread;
|
|
struct thread *thread;
|
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
|
struct perf_session *session = script->session;
|
|
struct perf_session *session = script->session;
|
|
- struct perf_evsel *evsel = perf_evlist__first(session->evlist);
|
|
|
|
|
|
+ struct perf_evsel *evsel = perf_evlist__id2evsel(session->evlist, sample->id);
|
|
|
|
|
|
if (perf_event__process_mmap2(tool, event, sample, machine) < 0)
|
|
if (perf_event__process_mmap2(tool, event, sample, machine) < 0)
|
|
return -1;
|
|
return -1;
|