All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: print warning when HAVE_DEBUGINFOD_SUPPORT is not set
@ 2022-04-20 13:32 Martin Liška
  2022-04-20 16:34 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2022-04-20 13:32 UTC (permalink / raw)
  To: lkml; +Cc: linux-perf-users, Jiri Olsa, Arnaldo Carvalho de Melo

When one requests debuginfod, either via --debuginfod option, or
with a perf-config value, complain when perf is not built with it.

Signed-off-by: Martin Liska <mliska@suse.cz>
---
  tools/perf/util/util.c | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index fb4f6616b5fa..289d83baaa2f 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -430,4 +430,9 @@ void perf_debuginfod_setup(struct perf_debuginfod *di)
  		setenv("DEBUGINFOD_URLS", di->urls, 1);
  
  	pr_debug("DEBUGINFOD_URLS=%s\n", getenv("DEBUGINFOD_URLS"));
+
+#ifndef HAVE_DEBUGINFOD_SUPPORT
+	if (di->set)
+		pr_warning("WARNING: debuginfod support requested, but perf is not built with it\n");
+#endif
  }
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] perf: print warning when HAVE_DEBUGINFOD_SUPPORT is not set
  2022-04-20 13:32 [PATCH] perf: print warning when HAVE_DEBUGINFOD_SUPPORT is not set Martin Liška
@ 2022-04-20 16:34 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-04-20 16:34 UTC (permalink / raw)
  To: Martin Liška; +Cc: lkml, linux-perf-users, Jiri Olsa

Em Wed, Apr 20, 2022 at 03:32:55PM +0200, Martin Liška escreveu:
> When one requests debuginfod, either via --debuginfod option, or
> with a perf-config value, complain when perf is not built with it.
> 
> Signed-off-by: Martin Liska <mliska@suse.cz>

I'll go and apply this manually:

⬢[acme@toolbox perf]$ am
warning: Patch sent with format=flowed; space at the end of lines might be lost.
Applying: perf: print warning when HAVE_DEBUGINFOD_SUPPORT is not set
error: corrupt patch at line 19
Patch failed at 0001 perf: print warning when HAVE_DEBUGINFOD_SUPPORT is not set
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
⬢[acme@toolbox perf]$ git am --abort
⬢[acme@toolbox perf]$ vim ~/wb/1.patch
⬢[acme@toolbox perf]$ patch -p1 < ~/wb/1.patch
patching file tools/perf/util/util.c
Hunk #1 FAILED at 430.
1 out of 1 hunk FAILED -- saving rejects to file tools/perf/util/util.c.rej
⬢[acme@toolbox perf]$ git diff
⬢[acme@toolbox perf]$
⬢[acme@toolbox perf]$ cat tools/perf/util/util.c.rej
--- tools/perf/util/util.c
+++ tools/perf/util/util.c
@@ -430,4 +430,9 @@ void perf_debuginfod_setup(struct perf_debuginfod *di)
  		setenv("DEBUGINFOD_URLS", di->urls, 1);

  	pr_debug("DEBUGINFOD_URLS=%s\n", getenv("DEBUGINFOD_URLS"));
+
+#ifndef HAVE_DEBUGINFOD_SUPPORT
+	if (di->set)
+		pr_warning("WARNING: debuginfod support requested, but perf is not built with it\n");
+#endif
  }
⬢[acme@toolbox perf]$

> ---
>  tools/perf/util/util.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
> index fb4f6616b5fa..289d83baaa2f 100644
> --- a/tools/perf/util/util.c
> +++ b/tools/perf/util/util.c
> @@ -430,4 +430,9 @@ void perf_debuginfod_setup(struct perf_debuginfod *di)
>  		setenv("DEBUGINFOD_URLS", di->urls, 1);
>  	pr_debug("DEBUGINFOD_URLS=%s\n", getenv("DEBUGINFOD_URLS"));
> +
> +#ifndef HAVE_DEBUGINFOD_SUPPORT
> +	if (di->set)
> +		pr_warning("WARNING: debuginfod support requested, but perf is not built with it\n");
> +#endif
>  }
> -- 
> 2.35.3

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-20 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 13:32 [PATCH] perf: print warning when HAVE_DEBUGINFOD_SUPPORT is not set Martin Liška
2022-04-20 16:34 ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.