|
@@ -381,7 +381,6 @@ exit:
|
|
|
|
|
|
static void python_process_tracepoint(struct perf_sample *sample,
|
|
static void python_process_tracepoint(struct perf_sample *sample,
|
|
struct perf_evsel *evsel,
|
|
struct perf_evsel *evsel,
|
|
- struct thread *thread,
|
|
|
|
struct addr_location *al)
|
|
struct addr_location *al)
|
|
{
|
|
{
|
|
struct event_format *event = evsel->tp_format;
|
|
struct event_format *event = evsel->tp_format;
|
|
@@ -395,7 +394,7 @@ static void python_process_tracepoint(struct perf_sample *sample,
|
|
int cpu = sample->cpu;
|
|
int cpu = sample->cpu;
|
|
void *data = sample->raw_data;
|
|
void *data = sample->raw_data;
|
|
unsigned long long nsecs = sample->time;
|
|
unsigned long long nsecs = sample->time;
|
|
- const char *comm = thread__comm_str(thread);
|
|
|
|
|
|
+ const char *comm = thread__comm_str(al->thread);
|
|
|
|
|
|
t = PyTuple_New(MAX_FIELDS);
|
|
t = PyTuple_New(MAX_FIELDS);
|
|
if (!t)
|
|
if (!t)
|
|
@@ -680,7 +679,7 @@ static int python_export_sample(struct db_export *dbe,
|
|
tuple_set_u64(t, 0, es->db_id);
|
|
tuple_set_u64(t, 0, es->db_id);
|
|
tuple_set_u64(t, 1, es->evsel->db_id);
|
|
tuple_set_u64(t, 1, es->evsel->db_id);
|
|
tuple_set_u64(t, 2, es->al->machine->db_id);
|
|
tuple_set_u64(t, 2, es->al->machine->db_id);
|
|
- tuple_set_u64(t, 3, es->thread->db_id);
|
|
|
|
|
|
+ tuple_set_u64(t, 3, es->al->thread->db_id);
|
|
tuple_set_u64(t, 4, es->comm_db_id);
|
|
tuple_set_u64(t, 4, es->comm_db_id);
|
|
tuple_set_u64(t, 5, es->dso_db_id);
|
|
tuple_set_u64(t, 5, es->dso_db_id);
|
|
tuple_set_u64(t, 6, es->sym_db_id);
|
|
tuple_set_u64(t, 6, es->sym_db_id);
|
|
@@ -766,7 +765,6 @@ static int python_process_call_return(struct call_return *cr, void *data)
|
|
|
|
|
|
static void python_process_general_event(struct perf_sample *sample,
|
|
static void python_process_general_event(struct perf_sample *sample,
|
|
struct perf_evsel *evsel,
|
|
struct perf_evsel *evsel,
|
|
- struct thread *thread,
|
|
|
|
struct addr_location *al)
|
|
struct addr_location *al)
|
|
{
|
|
{
|
|
PyObject *handler, *t, *dict, *callchain, *dict_sample;
|
|
PyObject *handler, *t, *dict, *callchain, *dict_sample;
|
|
@@ -816,7 +814,7 @@ static void python_process_general_event(struct perf_sample *sample,
|
|
pydict_set_item_string_decref(dict, "raw_buf", PyString_FromStringAndSize(
|
|
pydict_set_item_string_decref(dict, "raw_buf", PyString_FromStringAndSize(
|
|
(const char *)sample->raw_data, sample->raw_size));
|
|
(const char *)sample->raw_data, sample->raw_size));
|
|
pydict_set_item_string_decref(dict, "comm",
|
|
pydict_set_item_string_decref(dict, "comm",
|
|
- PyString_FromString(thread__comm_str(thread)));
|
|
|
|
|
|
+ PyString_FromString(thread__comm_str(al->thread)));
|
|
if (al->map) {
|
|
if (al->map) {
|
|
pydict_set_item_string_decref(dict, "dso",
|
|
pydict_set_item_string_decref(dict, "dso",
|
|
PyString_FromString(al->map->dso->name));
|
|
PyString_FromString(al->map->dso->name));
|
|
@@ -843,22 +841,20 @@ exit:
|
|
static void python_process_event(union perf_event *event,
|
|
static void python_process_event(union perf_event *event,
|
|
struct perf_sample *sample,
|
|
struct perf_sample *sample,
|
|
struct perf_evsel *evsel,
|
|
struct perf_evsel *evsel,
|
|
- struct thread *thread,
|
|
|
|
struct addr_location *al)
|
|
struct addr_location *al)
|
|
{
|
|
{
|
|
struct tables *tables = &tables_global;
|
|
struct tables *tables = &tables_global;
|
|
|
|
|
|
switch (evsel->attr.type) {
|
|
switch (evsel->attr.type) {
|
|
case PERF_TYPE_TRACEPOINT:
|
|
case PERF_TYPE_TRACEPOINT:
|
|
- python_process_tracepoint(sample, evsel, thread, al);
|
|
|
|
|
|
+ python_process_tracepoint(sample, evsel, al);
|
|
break;
|
|
break;
|
|
/* Reserve for future process_hw/sw/raw APIs */
|
|
/* Reserve for future process_hw/sw/raw APIs */
|
|
default:
|
|
default:
|
|
if (tables->db_export_mode)
|
|
if (tables->db_export_mode)
|
|
- db_export__sample(&tables->dbe, event, sample, evsel,
|
|
|
|
- thread, al);
|
|
|
|
|
|
+ db_export__sample(&tables->dbe, event, sample, evsel, al);
|
|
else
|
|
else
|
|
- python_process_general_event(sample, evsel, thread, al);
|
|
|
|
|
|
+ python_process_general_event(sample, evsel, al);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|