This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] sysroot: fix short release -r option handling follow up
- From: David Smith <dsmith at redhat dot com>
- To: Victor Kamensky <kamensky at cisco dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 22 Mar 2018 16:03:18 -0500
- Subject: Re: [PATCH] sysroot: fix short release -r option handling follow up
- References: <1521705927-7093-1-git-send-email-kamensky@cisco.com>
Ah, I see now that I misread your original patch. Checked in as commit
7e11f129f.
Thanks.
On Thu, Mar 22, 2018 at 3:05 AM, Victor Kamensky <kamensky@cisco.com> wrote:
> In case of sysroot set and short release -r option it does
> not make sense to pass short release name into
> dwfl_linux_kernel_report_offline function. This function
> is not aware about sysroot and it won't look for kernel
> modules under sysroot directory.
>
> In non empty sysroot case we construct absolute path
> name to kernel modules directory under sysroot using
> short release -r option value.
>
> Signed-off-by: Victor Kamensky <kamensky@cisco.com>
> ---
> setupdwfl.cxx | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/setupdwfl.cxx b/setupdwfl.cxx
> index f6c3157c1..9c8890052 100644
> --- a/setupdwfl.cxx
> +++ b/setupdwfl.cxx
> @@ -367,7 +367,15 @@ setup_dwfl_kernel (unsigned *modules_found, systemtap_session &s)
> // hard-code this magic here.
> string lib_path = s.sysroot + "/lib/modules/" + s.kernel_release + "/build";
> if (s.kernel_build_tree == lib_path)
> - elfutils_kernel_path = s.kernel_release;
> + {
> + if (s.sysroot != "")
> + // If we have sysroot set does not make sense to pass
> + // short release to dwfl, it won't take a sysroot into
> + // account. Let's construct full path in such case.
> + elfutils_kernel_path = string(s.sysroot + "/lib/modules/" + s.kernel_release);
> + else
> + elfutils_kernel_path = s.kernel_release;
> + }
> else
> elfutils_kernel_path = s.kernel_build_tree;
> offline_modules_found = 0;
> --
> 2.14.3
>
--
David Smith
Associate Manager
Red Hat