Lines Matching +full:full +full:- +full:custom
1 // SPDX-License-Identifier: GPL-2.0
19 * Usually the full path for a script is:
20 * /home/username/libexec/perf-core/scripts/python/xxx.py
21 * /home/username/libexec/perf-core/scripts/perl/xxx.pl
22 * So 256 should be long enough to contain the full path.
37 if (attr->read_format & PERF_FORMAT_GROUP) in attr_to_script()
38 strcat(extra_format, " -F +metric"); in attr_to_script()
39 if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) in attr_to_script()
40 strcat(extra_format, " -F +brstackinsn --xed"); in attr_to_script()
41 if (attr->sample_type & PERF_SAMPLE_REGS_INTR) in attr_to_script()
42 strcat(extra_format, " -F +iregs"); in attr_to_script()
43 if (attr->sample_type & PERF_SAMPLE_REGS_USER) in attr_to_script()
44 strcat(extra_format, " -F +uregs"); in attr_to_script()
45 if (attr->sample_type & PERF_SAMPLE_PHYS_ADDR) in attr_to_script()
46 strcat(extra_format, " -F +phys_addr"); in attr_to_script()
52 c->names[c->index] = name; in add_script_option()
53 if (asprintf(&c->paths[c->index], in add_script_option()
54 "%s script %s -F +metric %s %s", in add_script_option()
55 c->perf, opt, symbol_conf.inline_name ? " --inline" : "", in add_script_option()
56 c->extra_format) < 0) in add_script_option()
57 return -1; in add_script_option()
58 c->index++; in add_script_option()
67 return -1; in scripts_config()
68 if (c->index >= SCRIPT_MAX_NO) in scripts_config()
69 return -1; in scripts_config()
70 c->names[c->index] = strdup(var + 7); in scripts_config()
71 if (!c->names[c->index]) in scripts_config()
72 return -1; in scripts_config()
73 if (asprintf(&c->paths[c->index], "%s %s", value, in scripts_config()
74 c->extra_format) < 0) in scripts_config()
75 return -1; in scripts_config()
76 c->index++; in scripts_config()
81 * When success, will copy the full path of the selected script
83 * Return -1 on failure.
85 static int list_scripts(char *script_name, bool *custom, in list_scripts() argument
105 return -1; in list_scripts()
108 attr_to_script(scriptc.extra_format, &evsel->core.attr); in list_scripts()
110 add_script_option("Show individual samples with assembler", "-F +disasm", in list_scripts()
112 add_script_option("Show individual samples with source", "-F +srcline,+srccode", in list_scripts()
116 add_script_option("Show samples with custom perf script arguments", "", &scriptc); in list_scripts()
121 names[i] = buf + (i - max_std) * (SCRIPT_NAMELEN + SCRIPT_FULLPATH_LEN); in list_scripts()
125 num = find_scripts(names + max_std, paths + max_std, SCRIPT_MAX_NO - max_std, in list_scripts()
131 ret = -1; in list_scripts()
140 ret = -1; in list_scripts()
147 *custom = choice >= max_std; in list_scripts()
176 bool custom = false; in script_browse() local
179 if (list_scripts(script_name, &custom, evsel)) in script_browse()
180 return -1; in script_browse()
183 custom ? "perf script -s " : "", in script_browse()
186 input_name ? "-i " : "", in script_browse()
188 return -1; in script_browse()