Lines Matching refs:ofp

1597 	FILE *ofp;  in python_generate_script()  local
1600 ofp = fopen(fname, "w"); in python_generate_script()
1601 if (ofp == NULL) { in python_generate_script()
1605 fprintf(ofp, "# perf script event handlers, " in python_generate_script()
1608 fprintf(ofp, "# Licensed under the terms of the GNU GPL" in python_generate_script()
1611 fprintf(ofp, "# The common_* event handler fields are the most useful " in python_generate_script()
1614 fprintf(ofp, "# all events. They don't necessarily correspond to " in python_generate_script()
1617 fprintf(ofp, "# in the format files. Those fields not available as " in python_generate_script()
1620 fprintf(ofp, "# be retrieved using Python functions of the form " in python_generate_script()
1623 fprintf(ofp, "# See the perf-script-python Documentation for the list " in python_generate_script()
1626 fprintf(ofp, "from __future__ import print_function\n\n"); in python_generate_script()
1627 fprintf(ofp, "import os\n"); in python_generate_script()
1628 fprintf(ofp, "import sys\n\n"); in python_generate_script()
1630 fprintf(ofp, "sys.path.append(os.environ['PERF_EXEC_PATH'] + \\\n"); in python_generate_script()
1631 fprintf(ofp, "\t'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')\n"); in python_generate_script()
1632 fprintf(ofp, "\nfrom perf_trace_context import *\n"); in python_generate_script()
1633 fprintf(ofp, "from Core import *\n\n\n"); in python_generate_script()
1635 fprintf(ofp, "def trace_begin():\n"); in python_generate_script()
1636 fprintf(ofp, "\tprint(\"in trace_begin\")\n\n"); in python_generate_script()
1638 fprintf(ofp, "def trace_end():\n"); in python_generate_script()
1639 fprintf(ofp, "\tprint(\"in trace_end\")\n\n"); in python_generate_script()
1642 fprintf(ofp, "def %s__%s(", event->system, event->name); in python_generate_script()
1643 fprintf(ofp, "event_name, "); in python_generate_script()
1644 fprintf(ofp, "context, "); in python_generate_script()
1645 fprintf(ofp, "common_cpu,\n"); in python_generate_script()
1646 fprintf(ofp, "\tcommon_secs, "); in python_generate_script()
1647 fprintf(ofp, "common_nsecs, "); in python_generate_script()
1648 fprintf(ofp, "common_pid, "); in python_generate_script()
1649 fprintf(ofp, "common_comm,\n\t"); in python_generate_script()
1650 fprintf(ofp, "common_callchain, "); in python_generate_script()
1657 fprintf(ofp, ", "); in python_generate_script()
1659 fprintf(ofp, "\n\t"); in python_generate_script()
1661 fprintf(ofp, "%s", f->name); in python_generate_script()
1664 fprintf(ofp, ", "); in python_generate_script()
1666 fprintf(ofp, "\n\t\t"); in python_generate_script()
1667 fprintf(ofp, "perf_sample_dict"); in python_generate_script()
1669 fprintf(ofp, "):\n"); in python_generate_script()
1671 fprintf(ofp, "\t\tprint_header(event_name, common_cpu, " in python_generate_script()
1675 fprintf(ofp, "\t\tprint(\""); in python_generate_script()
1682 fprintf(ofp, ", "); in python_generate_script()
1684 fprintf(ofp, "\" \\\n\t\t\""); in python_generate_script()
1688 fprintf(ofp, "%s=", f->name); in python_generate_script()
1693 fprintf(ofp, "%%s"); in python_generate_script()
1695 fprintf(ofp, "%%d"); in python_generate_script()
1697 fprintf(ofp, "%%u"); in python_generate_script()
1700 fprintf(ofp, "\" %% \\\n\t\t("); in python_generate_script()
1707 fprintf(ofp, ", "); in python_generate_script()
1710 fprintf(ofp, "\n\t\t"); in python_generate_script()
1714 fprintf(ofp, "\n\t\t"); in python_generate_script()
1717 fprintf(ofp, "flag_str(\""); in python_generate_script()
1718 fprintf(ofp, "%s__%s\", ", event->system, in python_generate_script()
1720 fprintf(ofp, "\"%s\", %s)", f->name, in python_generate_script()
1724 fprintf(ofp, "\n\t\t"); in python_generate_script()
1727 fprintf(ofp, "symbol_str(\""); in python_generate_script()
1728 fprintf(ofp, "%s__%s\", ", event->system, in python_generate_script()
1730 fprintf(ofp, "\"%s\", %s)", f->name, in python_generate_script()
1733 fprintf(ofp, "%s", f->name); in python_generate_script()
1736 fprintf(ofp, "))\n\n"); in python_generate_script()
1738 fprintf(ofp, "\t\tprint('Sample: {'+" in python_generate_script()
1741 fprintf(ofp, "\t\tfor node in common_callchain:"); in python_generate_script()
1742 fprintf(ofp, "\n\t\t\tif 'sym' in node:"); in python_generate_script()
1743 fprintf(ofp, "\n\t\t\t\tprint(\"\\t[%%x] %%s\" %% (node['ip'], node['sym']['name']))"); in python_generate_script()
1744 fprintf(ofp, "\n\t\t\telse:"); in python_generate_script()
1745 fprintf(ofp, "\n\t\t\t\tprint(\"\t[%%x]\" %% (node['ip']))\n\n"); in python_generate_script()
1746 fprintf(ofp, "\t\tprint()\n\n"); in python_generate_script()
1750 fprintf(ofp, "def trace_unhandled(event_name, context, " in python_generate_script()
1753 fprintf(ofp, "\t\tprint(get_dict_as_string(event_fields_dict))\n"); in python_generate_script()
1754 fprintf(ofp, "\t\tprint('Sample: {'+" in python_generate_script()
1757 fprintf(ofp, "def print_header(" in python_generate_script()
1762 fprintf(ofp, "def get_dict_as_string(a_dict, delimiter=' '):\n" in python_generate_script()
1766 fclose(ofp); in python_generate_script()