Re: [PATCH 3/3] perf/probe: Add --bootconfig to output definition in bootconfig format

From: Masami Hiramatsu
Date: Fri Jun 18 2021 - 11:55:53 EST


Hi,

On Sat, 5 Jun 2021 01:28:43 +0900
Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:

> +int show_bootconfig_events(struct perf_probe_event *pevs, int npevs)
> +{
> + struct strlist *namelist = strlist__new(NULL, NULL);
> + struct probe_trace_event *tev;
> + struct perf_probe_event *pev;
> + char *cur_name = NULL;
> + int i, j, ret = 0;
> +
> + if (!namelist)
> + return -ENOMEM;
> +
> + for (j = 0; j < npevs && !ret; j++) {
> + pev = &pevs[j];
> + if (pev->group && strcmp(pev->group, "probe"))
> + pr_warning("WARN: Group name %s is ignored\n", pev->group);
> + if (pev->uprobes) {
> + pr_warning("ERROR: Bootconfig doesn't support uprobes\n");
> + ret = -EINVAL;
> + break;
> + }
> + for (i = 0; i < pev->ntevs && !ret; i++) {
> + tev = &pev->tevs[i];
> + /* Skip if the symbol is out of .text or blacklisted */
> + if (!tev->point.symbol && !pev->uprobes)
> + continue;
> +
> + /* Set new name for tev (and update namelist) */
> + ret = probe_trace_event__set_name(tev, pev,
> + namelist, true);
> + if (ret)
> + break;
> +
> + if (!cur_name || strcmp(cur_name, tev->event)) {
> + printf("%sftrace.event.kprobes.%s.probe = ",

Oops, I must not sleep well. this must be "%s.probes = ".
And I found this forgot to support return probes too.
Let me update it...

Thanks,


--
Masami Hiramatsu <mhiramat@xxxxxxxxxx>