Lines Matching refs:t
189 PyObject *t;
196 t = PyTuple_New(4);
197 if (!t)
198 Py_FatalError("couldn't create Python tuple");
202 PyTuple_SetItem(t, n++, _PyUnicode_FromString(ev_name));
203 PyTuple_SetItem(t, n++, _PyUnicode_FromString(field_name));
204 PyTuple_SetItem(t, n++, _PyLong_FromLong(value));
205 PyTuple_SetItem(t, n++, _PyUnicode_FromString(field_str));
207 try_call_object(handler_name, t);
209 Py_DECREF(t);
230 PyObject *t;
237 t = PyTuple_New(3);
239 t = PyTuple_New(2);
240 if (!t)
241 Py_FatalError("couldn't create Python tuple");
243 PyTuple_SetItem(t, n++, _PyUnicode_FromString(ev_name));
244 PyTuple_SetItem(t, n++, _PyUnicode_FromString(field_name));
246 PyTuple_SetItem(t, n++, _PyUnicode_FromString(delim));
248 try_call_object(handler_name, t);
250 Py_DECREF(t);
332 Py_FatalError("couldn't create Python list");
401 Py_FatalError("couldn't create Python list");
425 Py_FatalError("couldn't create Python dictionary");
434 Py_FatalError("couldn't create Python dictionary");
494 Py_FatalError("couldn't create Python list");
506 Py_FatalError("couldn't create Python dictionary");
583 Py_FatalError("couldn't create Python list");
595 Py_FatalError("couldn't create Python dictionary");
641 PyObject *t;
643 t = PyTuple_New(3);
644 if (!t)
645 Py_FatalError("couldn't create Python tuple");
646 PyTuple_SetItem(t, 0, PyLong_FromUnsignedLongLong(value->id));
647 PyTuple_SetItem(t, 1, PyLong_FromUnsignedLongLong(value->value));
649 PyTuple_SetItem(t, 2, PyLong_FromUnsignedLongLong(value->lost));
651 return t;
678 Py_FatalError("couldn't create Python list");
685 PyObject *t = get_sample_value_as_tuple(v, read_format);
686 PyList_SET_ITEM(values, i, t);
690 PyObject *t = get_sample_value_as_tuple(&sample->read.one,
692 PyList_SET_ITEM(values, 0, t);
704 Py_FatalError("couldn't create mem-info");
845 Py_FatalError("couldn't create Python dictionary");
849 Py_FatalError("couldn't create Python dictionary");
944 PyObject *handler, *context, *t, *obj = NULL, *callchain;
981 Py_FatalError("couldn't create Python dict");
984 t = PyTuple_New(MAX_FIELDS);
985 if (!t)
986 Py_FatalError("couldn't create Python tuple");
994 PyTuple_SetItem(t, n++, _PyUnicode_FromString(handler_name));
995 PyTuple_SetItem(t, n++, context);
1003 PyTuple_SetItem(t, n++, _PyLong_FromLong(cpu));
1004 PyTuple_SetItem(t, n++, _PyLong_FromLong(s));
1005 PyTuple_SetItem(t, n++, _PyLong_FromLong(ns));
1006 PyTuple_SetItem(t, n++, _PyLong_FromLong(pid));
1007 PyTuple_SetItem(t, n++, _PyUnicode_FromString(comm));
1008 PyTuple_SetItem(t, n++, callchain);
1044 PyTuple_SetItem(t, n++, obj);
1051 PyTuple_SetItem(t, n++, dict);
1056 PyTuple_SetItem(t, n++, all_entries_dict);
1061 if (_PyTuple_Resize(&t, n) == -1)
1065 call_object(handler, t, handler_name);
1067 call_object(handler, t, default_handler_name);
1069 Py_DECREF(t);
1084 PyObject *t;
1086 t = PyTuple_New(sz);
1087 if (!t)
1088 Py_FatalError("couldn't create Python tuple");
1089 return t;
1092 static int tuple_set_s64(PyObject *t, unsigned int pos, s64 val)
1095 return PyTuple_SetItem(t, pos, _PyLong_FromLong(val));
1098 return PyTuple_SetItem(t, pos, PyLong_FromLongLong(val));
1108 static int tuple_set_u64(PyObject *t, unsigned int pos, u64 val)
1111 return PyTuple_SetItem(t, pos, PyLong_FromUnsignedLong(val));
1114 return PyTuple_SetItem(t, pos, PyLong_FromUnsignedLongLong(val));
1118 static int tuple_set_u32(PyObject *t, unsigned int pos, u32 val)
1120 return PyTuple_SetItem(t, pos, PyLong_FromUnsignedLong(val));
1123 static int tuple_set_s32(PyObject *t, unsigned int pos, s32 val)
1125 return PyTuple_SetItem(t, pos, _PyLong_FromLong(val));
1128 static int tuple_set_bool(PyObject *t, unsigned int pos, bool val)
1130 return PyTuple_SetItem(t, pos, PyBool_FromLong(val));
1133 static int tuple_set_string(PyObject *t, unsigned int pos, const char *s)
1135 return PyTuple_SetItem(t, pos, _PyUnicode_FromString(s));
1138 static int tuple_set_bytes(PyObject *t, unsigned int pos, void *bytes,
1141 return PyTuple_SetItem(t, pos, _PyBytes_FromStringAndSize(bytes, sz));
1147 PyObject *t;
1149 t = tuple_new(2);
1151 tuple_set_d64(t, 0, evsel->db_id);
1152 tuple_set_string(t, 1, evsel__name(evsel));
1154 call_object(tables->evsel_handler, t, "evsel_table");
1156 Py_DECREF(t);
1165 PyObject *t;
1167 t = tuple_new(3);
1169 tuple_set_d64(t, 0, machine->db_id);
1170 tuple_set_s32(t, 1, machine->pid);
1171 tuple_set_string(t, 2, machine->root_dir ? machine->root_dir : "");
1173 call_object(tables->machine_handler, t, "machine_table");
1175 Py_DECREF(t);
1184 PyObject *t;
1186 t = tuple_new(5);
1188 tuple_set_d64(t, 0, thread__db_id(thread));
1189 tuple_set_d64(t, 1, machine->db_id);
1190 tuple_set_d64(t, 2, main_thread_db_id);
1191 tuple_set_s32(t, 3, thread__pid(thread));
1192 tuple_set_s32(t, 4, thread__tid(thread));
1194 call_object(tables->thread_handler, t, "thread_table");
1196 Py_DECREF(t);
1205 PyObject *t;
1207 t = tuple_new(5);
1209 tuple_set_d64(t, 0, comm->db_id);
1210 tuple_set_string(t, 1, comm__str(comm));
1211 tuple_set_d64(t, 2, thread__db_id(thread));
1212 tuple_set_d64(t, 3, comm->start);
1213 tuple_set_s32(t, 4, comm->exec);
1215 call_object(tables->comm_handler, t, "comm_table");
1217 Py_DECREF(t);
1226 PyObject *t;
1228 t = tuple_new(3);
1230 tuple_set_d64(t, 0, db_id);
1231 tuple_set_d64(t, 1, comm->db_id);
1232 tuple_set_d64(t, 2, thread__db_id(thread));
1234 call_object(tables->comm_thread_handler, t, "comm_thread_table");
1236 Py_DECREF(t);
1246 PyObject *t;
1250 t = tuple_new(5);
1252 tuple_set_d64(t, 0, dso__db_id(dso));
1253 tuple_set_d64(t, 1, machine->db_id);
1254 tuple_set_string(t, 2, dso__short_name(dso));
1255 tuple_set_string(t, 3, dso__long_name(dso));
1256 tuple_set_string(t, 4, sbuild_id);
1258 call_object(tables->dso_handler, t, "dso_table");
1260 Py_DECREF(t);
1270 PyObject *t;
1272 t = tuple_new(6);
1274 tuple_set_d64(t, 0, *sym_db_id);
1275 tuple_set_d64(t, 1, dso__db_id(dso));
1276 tuple_set_d64(t, 2, sym->start);
1277 tuple_set_d64(t, 3, sym->end);
1278 tuple_set_s32(t, 4, sym->binding);
1279 tuple_set_string(t, 5, sym->name);
1281 call_object(tables->symbol_handler, t, "symbol_table");
1283 Py_DECREF(t);
1292 PyObject *t;
1294 t = tuple_new(2);
1296 tuple_set_s32(t, 0, branch_type);
1297 tuple_set_string(t, 1, name);
1299 call_object(tables->branch_type_handler, t, "branch_type_table");
1301 Py_DECREF(t);
1310 PyObject *t;
1312 t = tuple_new(28);
1314 tuple_set_d64(t, 0, es->db_id);
1315 tuple_set_d64(t, 1, es->evsel->db_id);
1316 tuple_set_d64(t, 2, maps__machine(thread__maps(es->al->thread))->db_id);
1317 tuple_set_d64(t, 3, thread__db_id(es->al->thread));
1318 tuple_set_d64(t, 4, es->comm_db_id);
1319 tuple_set_d64(t, 5, es->dso_db_id);
1320 tuple_set_d64(t, 6, es->sym_db_id);
1321 tuple_set_d64(t, 7, es->offset);
1322 tuple_set_d64(t, 8, es->sample->ip);
1323 tuple_set_d64(t, 9, es->sample->time);
1324 tuple_set_s32(t, 10, es->sample->cpu);
1325 tuple_set_d64(t, 11, es->addr_dso_db_id);
1326 tuple_set_d64(t, 12, es->addr_sym_db_id);
1327 tuple_set_d64(t, 13, es->addr_offset);
1328 tuple_set_d64(t, 14, es->sample->addr);
1329 tuple_set_d64(t, 15, es->sample->period);
1330 tuple_set_d64(t, 16, es->sample->weight);
1331 tuple_set_d64(t, 17, es->sample->transaction);
1332 tuple_set_d64(t, 18, es->sample->data_src);
1333 tuple_set_s32(t, 19, es->sample->flags & PERF_BRANCH_MASK);
1334 tuple_set_s32(t, 20, !!(es->sample->flags & PERF_IP_FLAG_IN_TX));
1335 tuple_set_d64(t, 21, es->call_path_id);
1336 tuple_set_d64(t, 22, es->sample->insn_cnt);
1337 tuple_set_d64(t, 23, es->sample->cyc_cnt);
1338 tuple_set_s32(t, 24, es->sample->flags);
1339 tuple_set_d64(t, 25, es->sample->id);
1340 tuple_set_d64(t, 26, es->sample->stream_id);
1341 tuple_set_u32(t, 27, es->sample->ins_lat);
1343 call_object(tables->sample_handler, t, "sample_table");
1345 Py_DECREF(t);
1351 PyObject *t;
1353 t = tuple_new(3);
1355 tuple_set_d64(t, 0, es->db_id);
1356 tuple_set_d64(t, 1, es->evsel->core.attr.config);
1357 tuple_set_bytes(t, 2, es->sample->raw_data, es->sample->raw_size);
1359 call_object(tables->synth_handler, t, "synth_data");
1361 Py_DECREF(t);
1380 PyObject *t;
1386 t = tuple_new(4);
1388 tuple_set_d64(t, 0, cp->db_id);
1389 tuple_set_d64(t, 1, parent_db_id);
1390 tuple_set_d64(t, 2, sym_db_id);
1391 tuple_set_d64(t, 3, cp->ip);
1393 call_object(tables->call_path_handler, t, "call_path_table");
1395 Py_DECREF(t);
1405 PyObject *t;
1407 t = tuple_new(14);
1409 tuple_set_d64(t, 0, cr->db_id);
1410 tuple_set_d64(t, 1, thread__db_id(cr->thread));
1411 tuple_set_d64(t, 2, comm_db_id);
1412 tuple_set_d64(t, 3, cr->cp->db_id);
1413 tuple_set_d64(t, 4, cr->call_time);
1414 tuple_set_d64(t, 5, cr->return_time);
1415 tuple_set_d64(t, 6, cr->branch_count);
1416 tuple_set_d64(t, 7, cr->call_ref);
1417 tuple_set_d64(t, 8, cr->return_ref);
1418 tuple_set_d64(t, 9, cr->cp->parent->db_id);
1419 tuple_set_s32(t, 10, cr->flags);
1420 tuple_set_d64(t, 11, cr->parent_db_id);
1421 tuple_set_d64(t, 12, cr->insn_count);
1422 tuple_set_d64(t, 13, cr->cyc_count);
1424 call_object(tables->call_return_handler, t, "call_return_table");
1426 Py_DECREF(t);
1438 PyObject *t;
1440 t = tuple_new(9);
1442 tuple_set_d64(t, 0, db_id);
1443 tuple_set_d64(t, 1, machine->db_id);
1444 tuple_set_d64(t, 2, sample->time);
1445 tuple_set_s32(t, 3, sample->cpu);
1446 tuple_set_d64(t, 4, th_out_id);
1447 tuple_set_d64(t, 5, comm_out_id);
1448 tuple_set_d64(t, 6, th_in_id);
1449 tuple_set_d64(t, 7, comm_in_id);
1450 tuple_set_s32(t, 8, flags);
1452 call_object(tables->context_switch_handler, t, "context_switch");
1454 Py_DECREF(t);
1472 PyObject *handler, *t, *dict, *callchain;
1486 t = PyTuple_New(MAX_FIELDS);
1487 if (!t)
1488 Py_FatalError("couldn't create Python tuple");
1494 PyTuple_SetItem(t, n++, dict);
1495 if (_PyTuple_Resize(&t, n) == -1)
1498 call_object(handler, t, handler_name);
1500 Py_DECREF(t);
1531 PyObject *handler, *t;
1541 t = tuple_new(6);
1542 if (!t)
1545 tuple_set_u64(t, 0, event->throttle.time);
1546 tuple_set_u64(t, 1, event->throttle.id);
1547 tuple_set_u64(t, 2, event->throttle.stream_id);
1548 tuple_set_s32(t, 3, sample->cpu);
1549 tuple_set_s32(t, 4, sample->pid);
1550 tuple_set_s32(t, 5, sample->tid);
1552 call_object(handler, t, handler_name);
1554 Py_DECREF(t);
1565 PyObject *handler, *t;
1576 t = tuple_new(11);
1577 if (!t)
1580 tuple_set_u64(t, 0, sample->time);
1581 tuple_set_s32(t, 1, sample->cpu);
1582 tuple_set_s32(t, 2, sample->pid);
1583 tuple_set_s32(t, 3, sample->tid);
1584 tuple_set_s32(t, 4, np_pid);
1585 tuple_set_s32(t, 5, np_tid);
1586 tuple_set_s32(t, 6, machine->pid);
1587 tuple_set_bool(t, 7, out);
1588 tuple_set_bool(t, 8, out_preempt);
1589 tuple_set_s32(t, 9, sample->machine_pid);
1590 tuple_set_s32(t, 10, sample->vcpu);
1592 call_object(handler, t, handler_name);
1594 Py_DECREF(t);
1617 PyObject *handler, *t;
1628 t = tuple_new(11);
1630 tuple_set_u32(t, 0, e->type);
1631 tuple_set_u32(t, 1, e->code);
1632 tuple_set_s32(t, 2, e->cpu);
1633 tuple_set_s32(t, 3, e->pid);
1634 tuple_set_s32(t, 4, e->tid);
1635 tuple_set_u64(t, 5, e->ip);
1636 tuple_set_u64(t, 6, tm);
1637 tuple_set_string(t, 7, msg);
1638 tuple_set_u32(t, 8, cpumode);
1639 tuple_set_s32(t, 9, e->machine_pid);
1640 tuple_set_s32(t, 10, e->vcpu);
1642 call_object(handler, t, handler_name);
1644 Py_DECREF(t);
1664 PyObject *handler, *t;
1668 t = PyTuple_New(MAX_FIELDS);
1669 if (!t)
1670 Py_FatalError("couldn't create Python tuple");
1677 pr_debug("can't find python handler %s\n", handler_name);
1681 PyTuple_SetItem(t, n++, _PyLong_FromLong(cpu.cpu));
1682 PyTuple_SetItem(t, n++, _PyLong_FromLong(thread));
1684 tuple_set_u64(t, n++, tstamp);
1685 tuple_set_u64(t, n++, count->val);
1686 tuple_set_u64(t, n++, count->ena);
1687 tuple_set_u64(t, n++, count->run);
1689 if (_PyTuple_Resize(&t, n) == -1)
1692 call_object(handler, t, handler_name);
1694 Py_DECREF(t);
1717 PyObject *handler, *t;
1721 t = PyTuple_New(MAX_FIELDS);
1722 if (!t)
1723 Py_FatalError("couldn't create Python tuple");
1727 pr_debug("can't find python handler %s\n", handler_name);
1731 tuple_set_u64(t, n++, tstamp);
1733 if (_PyTuple_Resize(&t, n) == -1)
1736 call_object(handler, t, handler_name);
1738 Py_DECREF(t);
1933 sprintf(buf, "Can't open python script \"%s\"", script);
2005 fprintf(stderr, "couldn't open %s\n", fname);
2017 fprintf(ofp, "# all events. They don't necessarily correspond to "
2034 fprintf(ofp, "\t'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')\n");
2056 fprintf(ofp, "common_comm,\n\t");
2066 fprintf(ofp, "\n\t");
2073 fprintf(ofp, "\n\t\t");
2078 fprintf(ofp, "\t\tprint_header(event_name, common_cpu, "
2079 "common_secs, common_nsecs,\n\t\t\t"
2082 fprintf(ofp, "\t\tprint(\"");
2091 fprintf(ofp, "\" \\\n\t\t\"");
2107 fprintf(ofp, "\" %% \\\n\t\t(");
2117 fprintf(ofp, "\n\t\t");
2121 fprintf(ofp, "\n\t\t");
2131 fprintf(ofp, "\n\t\t");
2145 fprintf(ofp, "\t\tprint('Sample: {'+"
2148 fprintf(ofp, "\t\tfor node in common_callchain:");
2149 fprintf(ofp, "\n\t\t\tif 'sym' in node:");
2150 fprintf(ofp, "\n\t\t\t\tprint(\"\t[%%x] %%s%%s%%s%%s\" %% (");
2151 fprintf(ofp, "\n\t\t\t\t\tnode['ip'], node['sym']['name'],");
2152 fprintf(ofp, "\n\t\t\t\t\t\"+0x{:x}\".format(node['sym_off']) if 'sym_off' in node else \"\",");
2153 fprintf(ofp, "\n\t\t\t\t\t\" ({})\".format(node['dso']) if 'dso' in node else \"\",");
2154 fprintf(ofp, "\n\t\t\t\t\t\" \" + node['sym_srcline'] if 'sym_srcline' in node else \"\"))");
2155 fprintf(ofp, "\n\t\t\telse:");
2156 fprintf(ofp, "\n\t\t\t\tprint(\"\t[%%x]\" %% (node['ip']))\n\n");
2157 fprintf(ofp, "\t\tprint()\n\n");
2164 fprintf(ofp, "\t\tprint(get_dict_as_string(event_fields_dict))\n");
2165 fprintf(ofp, "\t\tprint('Sample: {'+"
2170 "\tprint(\"%%-20s %%5u %%05u.%%09u %%8u %%-20s \" %% \\\n\t"