Lines Matching refs:ofp

1713 	FILE *ofp;
1716 ofp = fopen(fname, "w");
1717 if (ofp == NULL) {
1721 fprintf(ofp, "# perf script event handlers, "
1724 fprintf(ofp, "# Licensed under the terms of the GNU GPL"
1727 fprintf(ofp, "# The common_* event handler fields are the most useful "
1730 fprintf(ofp, "# all events. They don't necessarily correspond to "
1733 fprintf(ofp, "# in the format files. Those fields not available as "
1736 fprintf(ofp, "# be retrieved using Python functions of the form "
1739 fprintf(ofp, "# See the perf-script-python Documentation for the list "
1742 fprintf(ofp, "from __future__ import print_function\n\n");
1743 fprintf(ofp, "import os\n");
1744 fprintf(ofp, "import sys\n\n");
1746 fprintf(ofp, "sys.path.append(os.environ['PERF_EXEC_PATH'] + \\\n");
1747 fprintf(ofp, "\t'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')\n");
1748 fprintf(ofp, "\nfrom perf_trace_context import *\n");
1749 fprintf(ofp, "from Core import *\n\n\n");
1751 fprintf(ofp, "def trace_begin():\n");
1752 fprintf(ofp, "\tprint(\"in trace_begin\")\n\n");
1754 fprintf(ofp, "def trace_end():\n");
1755 fprintf(ofp, "\tprint(\"in trace_end\")\n\n");
1762 fprintf(ofp, "def %s__%s(", event->system, event->name);
1763 fprintf(ofp, "event_name, ");
1764 fprintf(ofp, "context, ");
1765 fprintf(ofp, "common_cpu,\n");
1766 fprintf(ofp, "\tcommon_secs, ");
1767 fprintf(ofp, "common_nsecs, ");
1768 fprintf(ofp, "common_pid, ");
1769 fprintf(ofp, "common_comm,\n\t");
1770 fprintf(ofp, "common_callchain, ");
1777 fprintf(ofp, ", ");
1779 fprintf(ofp, "\n\t");
1781 fprintf(ofp, "%s", f->name);
1784 fprintf(ofp, ", ");
1786 fprintf(ofp, "\n\t\t");
1787 fprintf(ofp, "perf_sample_dict");
1789 fprintf(ofp, "):\n");
1791 fprintf(ofp, "\t\tprint_header(event_name, common_cpu, "
1795 fprintf(ofp, "\t\tprint(\"");
1802 fprintf(ofp, ", ");
1804 fprintf(ofp, "\" \\\n\t\t\"");
1808 fprintf(ofp, "%s=", f->name);
1813 fprintf(ofp, "%%s");
1815 fprintf(ofp, "%%d");
1817 fprintf(ofp, "%%u");
1820 fprintf(ofp, "\" %% \\\n\t\t(");
1827 fprintf(ofp, ", ");
1830 fprintf(ofp, "\n\t\t");
1834 fprintf(ofp, "\n\t\t");
1837 fprintf(ofp, "flag_str(\"");
1838 fprintf(ofp, "%s__%s\", ", event->system,
1840 fprintf(ofp, "\"%s\", %s)", f->name,
1844 fprintf(ofp, "\n\t\t");
1847 fprintf(ofp, "symbol_str(\"");
1848 fprintf(ofp, "%s__%s\", ", event->system,
1850 fprintf(ofp, "\"%s\", %s)", f->name,
1853 fprintf(ofp, "%s", f->name);
1856 fprintf(ofp, "))\n\n");
1858 fprintf(ofp, "\t\tprint('Sample: {'+"
1861 fprintf(ofp, "\t\tfor node in common_callchain:");
1862 fprintf(ofp, "\n\t\t\tif 'sym' in node:");
1863 fprintf(ofp, "\n\t\t\t\tprint(\"\\t[%%x] %%s\" %% (node['ip'], node['sym']['name']))");
1864 fprintf(ofp, "\n\t\t\telse:");
1865 fprintf(ofp, "\n\t\t\t\tprint(\"\t[%%x]\" %% (node['ip']))\n\n");
1866 fprintf(ofp, "\t\tprint()\n\n");
1870 fprintf(ofp, "def trace_unhandled(event_name, context, "
1873 fprintf(ofp, "\t\tprint(get_dict_as_string(event_fields_dict))\n");
1874 fprintf(ofp, "\t\tprint('Sample: {'+"
1877 fprintf(ofp, "def print_header("
1882 fprintf(ofp, "def get_dict_as_string(a_dict, delimiter=' '):\n"
1886 fclose(ofp);