Lines Matching refs:ofp

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