Lines Matching refs:ofp
1697 FILE *ofp; in python_generate_script() local
1700 ofp = fopen(fname, "w"); in python_generate_script()
1701 if (ofp == NULL) { in python_generate_script()
1705 fprintf(ofp, "# perf script event handlers, " in python_generate_script()
1708 fprintf(ofp, "# Licensed under the terms of the GNU GPL" in python_generate_script()
1711 fprintf(ofp, "# The common_* event handler fields are the most useful " in python_generate_script()
1714 fprintf(ofp, "# all events. They don't necessarily correspond to " in python_generate_script()
1717 fprintf(ofp, "# in the format files. Those fields not available as " in python_generate_script()
1720 fprintf(ofp, "# be retrieved using Python functions of the form " in python_generate_script()
1723 fprintf(ofp, "# See the perf-script-python Documentation for the list " in python_generate_script()
1726 fprintf(ofp, "from __future__ import print_function\n\n"); in python_generate_script()
1727 fprintf(ofp, "import os\n"); in python_generate_script()
1728 fprintf(ofp, "import sys\n\n"); in python_generate_script()
1730 fprintf(ofp, "sys.path.append(os.environ['PERF_EXEC_PATH'] + \\\n"); in python_generate_script()
1731 fprintf(ofp, "\t'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')\n"); in python_generate_script()
1732 fprintf(ofp, "\nfrom perf_trace_context import *\n"); in python_generate_script()
1733 fprintf(ofp, "from Core import *\n\n\n"); in python_generate_script()
1735 fprintf(ofp, "def trace_begin():\n"); in python_generate_script()
1736 fprintf(ofp, "\tprint(\"in trace_begin\")\n\n"); in python_generate_script()
1738 fprintf(ofp, "def trace_end():\n"); in python_generate_script()
1739 fprintf(ofp, "\tprint(\"in trace_end\")\n\n"); in python_generate_script()
1746 fprintf(ofp, "def %s__%s(", event->system, event->name); in python_generate_script()
1747 fprintf(ofp, "event_name, "); in python_generate_script()
1748 fprintf(ofp, "context, "); in python_generate_script()
1749 fprintf(ofp, "common_cpu,\n"); in python_generate_script()
1750 fprintf(ofp, "\tcommon_secs, "); in python_generate_script()
1751 fprintf(ofp, "common_nsecs, "); in python_generate_script()
1752 fprintf(ofp, "common_pid, "); in python_generate_script()
1753 fprintf(ofp, "common_comm,\n\t"); in python_generate_script()
1754 fprintf(ofp, "common_callchain, "); in python_generate_script()
1761 fprintf(ofp, ", "); in python_generate_script()
1763 fprintf(ofp, "\n\t"); in python_generate_script()
1765 fprintf(ofp, "%s", f->name); in python_generate_script()
1768 fprintf(ofp, ", "); in python_generate_script()
1770 fprintf(ofp, "\n\t\t"); in python_generate_script()
1771 fprintf(ofp, "perf_sample_dict"); in python_generate_script()
1773 fprintf(ofp, "):\n"); in python_generate_script()
1775 fprintf(ofp, "\t\tprint_header(event_name, common_cpu, " in python_generate_script()
1779 fprintf(ofp, "\t\tprint(\""); in python_generate_script()
1786 fprintf(ofp, ", "); in python_generate_script()
1788 fprintf(ofp, "\" \\\n\t\t\""); in python_generate_script()
1792 fprintf(ofp, "%s=", f->name); in python_generate_script()
1797 fprintf(ofp, "%%s"); in python_generate_script()
1799 fprintf(ofp, "%%d"); in python_generate_script()
1801 fprintf(ofp, "%%u"); in python_generate_script()
1804 fprintf(ofp, "\" %% \\\n\t\t("); in python_generate_script()
1811 fprintf(ofp, ", "); in python_generate_script()
1814 fprintf(ofp, "\n\t\t"); in python_generate_script()
1818 fprintf(ofp, "\n\t\t"); in python_generate_script()
1821 fprintf(ofp, "flag_str(\""); in python_generate_script()
1822 fprintf(ofp, "%s__%s\", ", event->system, in python_generate_script()
1824 fprintf(ofp, "\"%s\", %s)", f->name, in python_generate_script()
1828 fprintf(ofp, "\n\t\t"); in python_generate_script()
1831 fprintf(ofp, "symbol_str(\""); in python_generate_script()
1832 fprintf(ofp, "%s__%s\", ", event->system, in python_generate_script()
1834 fprintf(ofp, "\"%s\", %s)", f->name, in python_generate_script()
1837 fprintf(ofp, "%s", f->name); in python_generate_script()
1840 fprintf(ofp, "))\n\n"); in python_generate_script()
1842 fprintf(ofp, "\t\tprint('Sample: {'+" in python_generate_script()
1845 fprintf(ofp, "\t\tfor node in common_callchain:"); in python_generate_script()
1846 fprintf(ofp, "\n\t\t\tif 'sym' in node:"); in python_generate_script()
1847 fprintf(ofp, "\n\t\t\t\tprint(\"\\t[%%x] %%s\" %% (node['ip'], node['sym']['name']))"); in python_generate_script()
1848 fprintf(ofp, "\n\t\t\telse:"); in python_generate_script()
1849 fprintf(ofp, "\n\t\t\t\tprint(\"\t[%%x]\" %% (node['ip']))\n\n"); in python_generate_script()
1850 fprintf(ofp, "\t\tprint()\n\n"); in python_generate_script()
1854 fprintf(ofp, "def trace_unhandled(event_name, context, " in python_generate_script()
1857 fprintf(ofp, "\t\tprint(get_dict_as_string(event_fields_dict))\n"); in python_generate_script()
1858 fprintf(ofp, "\t\tprint('Sample: {'+" in python_generate_script()
1861 fprintf(ofp, "def print_header(" in python_generate_script()
1866 fprintf(ofp, "def get_dict_as_string(a_dict, delimiter=' '):\n" in python_generate_script()
1870 fclose(ofp); in python_generate_script()