Lines Matching refs:ofp

2009 	FILE *ofp;  in python_generate_script()  local
2012 ofp = fopen(fname, "w"); in python_generate_script()
2013 if (ofp == NULL) { in python_generate_script()
2017 fprintf(ofp, "# perf script event handlers, " in python_generate_script()
2020 fprintf(ofp, "# Licensed under the terms of the GNU GPL" in python_generate_script()
2023 fprintf(ofp, "# The common_* event handler fields are the most useful " in python_generate_script()
2026 fprintf(ofp, "# all events. They don't necessarily correspond to " in python_generate_script()
2029 fprintf(ofp, "# in the format files. Those fields not available as " in python_generate_script()
2032 fprintf(ofp, "# be retrieved using Python functions of the form " in python_generate_script()
2035 fprintf(ofp, "# See the perf-script-python Documentation for the list " in python_generate_script()
2038 fprintf(ofp, "from __future__ import print_function\n\n"); in python_generate_script()
2039 fprintf(ofp, "import os\n"); in python_generate_script()
2040 fprintf(ofp, "import sys\n\n"); in python_generate_script()
2042 fprintf(ofp, "sys.path.append(os.environ['PERF_EXEC_PATH'] + \\\n"); in python_generate_script()
2043 fprintf(ofp, "\t'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')\n"); in python_generate_script()
2044 fprintf(ofp, "\nfrom perf_trace_context import *\n"); in python_generate_script()
2045 fprintf(ofp, "from Core import *\n\n\n"); in python_generate_script()
2047 fprintf(ofp, "def trace_begin():\n"); in python_generate_script()
2048 fprintf(ofp, "\tprint(\"in trace_begin\")\n\n"); in python_generate_script()
2050 fprintf(ofp, "def trace_end():\n"); in python_generate_script()
2051 fprintf(ofp, "\tprint(\"in trace_end\")\n\n"); in python_generate_script()
2058 fprintf(ofp, "def %s__%s(", event->system, event->name); in python_generate_script()
2059 fprintf(ofp, "event_name, "); in python_generate_script()
2060 fprintf(ofp, "context, "); in python_generate_script()
2061 fprintf(ofp, "common_cpu,\n"); in python_generate_script()
2062 fprintf(ofp, "\tcommon_secs, "); in python_generate_script()
2063 fprintf(ofp, "common_nsecs, "); in python_generate_script()
2064 fprintf(ofp, "common_pid, "); in python_generate_script()
2065 fprintf(ofp, "common_comm,\n\t"); in python_generate_script()
2066 fprintf(ofp, "common_callchain, "); in python_generate_script()
2073 fprintf(ofp, ", "); in python_generate_script()
2075 fprintf(ofp, "\n\t"); in python_generate_script()
2077 fprintf(ofp, "%s", f->name); in python_generate_script()
2080 fprintf(ofp, ", "); in python_generate_script()
2082 fprintf(ofp, "\n\t\t"); in python_generate_script()
2083 fprintf(ofp, "perf_sample_dict"); in python_generate_script()
2085 fprintf(ofp, "):\n"); in python_generate_script()
2087 fprintf(ofp, "\t\tprint_header(event_name, common_cpu, " in python_generate_script()
2091 fprintf(ofp, "\t\tprint(\""); in python_generate_script()
2098 fprintf(ofp, ", "); in python_generate_script()
2100 fprintf(ofp, "\" \\\n\t\t\""); in python_generate_script()
2104 fprintf(ofp, "%s=", f->name); in python_generate_script()
2109 fprintf(ofp, "%%s"); in python_generate_script()
2111 fprintf(ofp, "%%d"); in python_generate_script()
2113 fprintf(ofp, "%%u"); in python_generate_script()
2116 fprintf(ofp, "\" %% \\\n\t\t("); in python_generate_script()
2123 fprintf(ofp, ", "); in python_generate_script()
2126 fprintf(ofp, "\n\t\t"); in python_generate_script()
2130 fprintf(ofp, "\n\t\t"); in python_generate_script()
2133 fprintf(ofp, "flag_str(\""); in python_generate_script()
2134 fprintf(ofp, "%s__%s\", ", event->system, in python_generate_script()
2136 fprintf(ofp, "\"%s\", %s)", f->name, in python_generate_script()
2140 fprintf(ofp, "\n\t\t"); in python_generate_script()
2143 fprintf(ofp, "symbol_str(\""); in python_generate_script()
2144 fprintf(ofp, "%s__%s\", ", event->system, in python_generate_script()
2146 fprintf(ofp, "\"%s\", %s)", f->name, in python_generate_script()
2149 fprintf(ofp, "%s", f->name); in python_generate_script()
2152 fprintf(ofp, "))\n\n"); in python_generate_script()
2154 fprintf(ofp, "\t\tprint('Sample: {'+" in python_generate_script()
2157 fprintf(ofp, "\t\tfor node in common_callchain:"); in python_generate_script()
2158 fprintf(ofp, "\n\t\t\tif 'sym' in node:"); in python_generate_script()
2159 fprintf(ofp, "\n\t\t\t\tprint(\"\t[%%x] %%s%%s%%s%%s\" %% ("); in python_generate_script()
2160 fprintf(ofp, "\n\t\t\t\t\tnode['ip'], node['sym']['name'],"); in python_generate_script()
2161 fprintf(ofp, "\n\t\t\t\t\t\"+0x{:x}\".format(node['sym_off']) if 'sym_off' in node else \"\","); in python_generate_script()
2162 fprintf(ofp, "\n\t\t\t\t\t\" ({})\".format(node['dso']) if 'dso' in node else \"\","); in python_generate_script()
2163 fprintf(ofp, "\n\t\t\t\t\t\" \" + node['sym_srcline'] if 'sym_srcline' in node else \"\"))"); in python_generate_script()
2164 fprintf(ofp, "\n\t\t\telse:"); in python_generate_script()
2165 fprintf(ofp, "\n\t\t\t\tprint(\"\t[%%x]\" %% (node['ip']))\n\n"); in python_generate_script()
2166 fprintf(ofp, "\t\tprint()\n\n"); in python_generate_script()
2170 fprintf(ofp, "def trace_unhandled(event_name, context, " in python_generate_script()
2173 fprintf(ofp, "\t\tprint(get_dict_as_string(event_fields_dict))\n"); in python_generate_script()
2174 fprintf(ofp, "\t\tprint('Sample: {'+" in python_generate_script()
2177 fprintf(ofp, "def print_header(" in python_generate_script()
2182 fprintf(ofp, "def get_dict_as_string(a_dict, delimiter=' '):\n" in python_generate_script()
2186 fclose(ofp); in python_generate_script()