Lines Matching refs:ofp
1193 FILE *ofp; in python_generate_script() local
1196 ofp = fopen(fname, "w"); in python_generate_script()
1197 if (ofp == NULL) { in python_generate_script()
1201 fprintf(ofp, "# perf script event handlers, " in python_generate_script()
1204 fprintf(ofp, "# Licensed under the terms of the GNU GPL" in python_generate_script()
1207 fprintf(ofp, "# The common_* event handler fields are the most useful " in python_generate_script()
1210 fprintf(ofp, "# all events. They don't necessarily correspond to " in python_generate_script()
1213 fprintf(ofp, "# in the format files. Those fields not available as " in python_generate_script()
1216 fprintf(ofp, "# be retrieved using Python functions of the form " in python_generate_script()
1219 fprintf(ofp, "# See the perf-trace-python Documentation for the list " in python_generate_script()
1222 fprintf(ofp, "import os\n"); in python_generate_script()
1223 fprintf(ofp, "import sys\n\n"); in python_generate_script()
1225 fprintf(ofp, "sys.path.append(os.environ['PERF_EXEC_PATH'] + \\\n"); in python_generate_script()
1226 fprintf(ofp, "\t'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')\n"); in python_generate_script()
1227 fprintf(ofp, "\nfrom perf_trace_context import *\n"); in python_generate_script()
1228 fprintf(ofp, "from Core import *\n\n\n"); in python_generate_script()
1230 fprintf(ofp, "def trace_begin():\n"); in python_generate_script()
1231 fprintf(ofp, "\tprint \"in trace_begin\"\n\n"); in python_generate_script()
1233 fprintf(ofp, "def trace_end():\n"); in python_generate_script()
1234 fprintf(ofp, "\tprint \"in trace_end\"\n\n"); in python_generate_script()
1237 fprintf(ofp, "def %s__%s(", event->system, event->name); in python_generate_script()
1238 fprintf(ofp, "event_name, "); in python_generate_script()
1239 fprintf(ofp, "context, "); in python_generate_script()
1240 fprintf(ofp, "common_cpu,\n"); in python_generate_script()
1241 fprintf(ofp, "\tcommon_secs, "); in python_generate_script()
1242 fprintf(ofp, "common_nsecs, "); in python_generate_script()
1243 fprintf(ofp, "common_pid, "); in python_generate_script()
1244 fprintf(ofp, "common_comm,\n\t"); in python_generate_script()
1245 fprintf(ofp, "common_callchain, "); in python_generate_script()
1252 fprintf(ofp, ", "); in python_generate_script()
1254 fprintf(ofp, "\n\t"); in python_generate_script()
1256 fprintf(ofp, "%s", f->name); in python_generate_script()
1258 fprintf(ofp, "):\n"); in python_generate_script()
1260 fprintf(ofp, "\t\tprint_header(event_name, common_cpu, " in python_generate_script()
1264 fprintf(ofp, "\t\tprint \""); in python_generate_script()
1271 fprintf(ofp, ", "); in python_generate_script()
1273 fprintf(ofp, "\" \\\n\t\t\""); in python_generate_script()
1277 fprintf(ofp, "%s=", f->name); in python_generate_script()
1282 fprintf(ofp, "%%s"); in python_generate_script()
1284 fprintf(ofp, "%%d"); in python_generate_script()
1286 fprintf(ofp, "%%u"); in python_generate_script()
1289 fprintf(ofp, "\" %% \\\n\t\t("); in python_generate_script()
1296 fprintf(ofp, ", "); in python_generate_script()
1299 fprintf(ofp, "\n\t\t"); in python_generate_script()
1303 fprintf(ofp, "\n\t\t"); in python_generate_script()
1306 fprintf(ofp, "flag_str(\""); in python_generate_script()
1307 fprintf(ofp, "%s__%s\", ", event->system, in python_generate_script()
1309 fprintf(ofp, "\"%s\", %s)", f->name, in python_generate_script()
1313 fprintf(ofp, "\n\t\t"); in python_generate_script()
1316 fprintf(ofp, "symbol_str(\""); in python_generate_script()
1317 fprintf(ofp, "%s__%s\", ", event->system, in python_generate_script()
1319 fprintf(ofp, "\"%s\", %s)", f->name, in python_generate_script()
1322 fprintf(ofp, "%s", f->name); in python_generate_script()
1325 fprintf(ofp, ")\n\n"); in python_generate_script()
1327 fprintf(ofp, "\t\tfor node in common_callchain:"); in python_generate_script()
1328 fprintf(ofp, "\n\t\t\tif 'sym' in node:"); in python_generate_script()
1329 fprintf(ofp, "\n\t\t\t\tprint \"\\t[%%x] %%s\" %% (node['ip'], node['sym']['name'])"); in python_generate_script()
1330 fprintf(ofp, "\n\t\t\telse:"); in python_generate_script()
1331 fprintf(ofp, "\n\t\t\t\tprint \"\t[%%x]\" %% (node['ip'])\n\n"); in python_generate_script()
1332 fprintf(ofp, "\t\tprint \"\\n\"\n\n"); in python_generate_script()
1336 fprintf(ofp, "def trace_unhandled(event_name, context, " in python_generate_script()
1339 fprintf(ofp, "\t\tprint ' '.join(['%%s=%%s'%%(k,str(v))" in python_generate_script()
1342 fprintf(ofp, "def print_header(" in python_generate_script()
1347 fclose(ofp); in python_generate_script()