|
@@ -225,7 +225,7 @@ static void python_process_tracepoint(union perf_event *perf_event __unused,
|
|
|
struct perf_sample *sample,
|
|
|
struct perf_evsel *evsel,
|
|
|
struct machine *machine __unused,
|
|
|
- struct thread *thread)
|
|
|
+ struct addr_location *al)
|
|
|
{
|
|
|
PyObject *handler, *retval, *context, *t, *obj, *dict = NULL;
|
|
|
static char handler_name[256];
|
|
@@ -238,6 +238,7 @@ static void python_process_tracepoint(union perf_event *perf_event __unused,
|
|
|
int cpu = sample->cpu;
|
|
|
void *data = sample->raw_data;
|
|
|
unsigned long long nsecs = sample->time;
|
|
|
+ struct thread *thread = al->thread;
|
|
|
char *comm = thread->comm;
|
|
|
|
|
|
t = PyTuple_New(MAX_FIELDS);
|
|
@@ -342,7 +343,7 @@ static void python_process_general_event(union perf_event *perf_event __unused,
|
|
|
struct perf_sample *sample,
|
|
|
struct perf_evsel *evsel,
|
|
|
struct machine *machine __unused,
|
|
|
- struct thread *thread __unused)
|
|
|
+ struct addr_location *al __unused)
|
|
|
{
|
|
|
PyObject *handler, *retval, *t;
|
|
|
static char handler_name[64];
|
|
@@ -361,7 +362,7 @@ static void python_process_general_event(union perf_event *perf_event __unused,
|
|
|
goto exit;
|
|
|
}
|
|
|
|
|
|
- /* Pass 3 parameters: event_attr, perf_sample, raw data */
|
|
|
+ /* Pass 4 parameters: event_attr, perf_sample, raw data, thread name */
|
|
|
PyTuple_SetItem(t, n++, PyString_FromStringAndSize((void *)&evsel->attr, sizeof(evsel->attr)));
|
|
|
PyTuple_SetItem(t, n++, PyString_FromStringAndSize((void *)sample, sizeof(*sample)));
|
|
|
PyTuple_SetItem(t, n++, PyString_FromStringAndSize(data, sample->raw_size));
|
|
@@ -380,17 +381,17 @@ static void python_process_event(union perf_event *perf_event,
|
|
|
struct perf_sample *sample,
|
|
|
struct perf_evsel *evsel,
|
|
|
struct machine *machine,
|
|
|
- struct thread *thread)
|
|
|
+ struct addr_location *al)
|
|
|
{
|
|
|
switch (evsel->attr.type) {
|
|
|
case PERF_TYPE_TRACEPOINT:
|
|
|
python_process_tracepoint(perf_event, sample, evsel,
|
|
|
- machine, thread);
|
|
|
+ machine, al);
|
|
|
break;
|
|
|
/* Reserve for future process_hw/sw/raw APIs */
|
|
|
default:
|
|
|
python_process_general_event(perf_event, sample, evsel,
|
|
|
- machine, thread);
|
|
|
+ machine, al);
|
|
|
}
|
|
|
}
|
|
|
|