lkml.org 
[lkml]   [2019]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 01/16] dyndbg: drop trim_prefix, obsoleted by __FILE__s relative path
Cool, thanks!


On Wed, Oct 30, 2019 at 3:20 PM Rasmus Villemoes
<linux@rasmusvillemoes.dk> wrote:
>
> On 29/10/2019 21.00, Jim Cromie wrote:
> > Regarding:
> > commit 2b6783191da7 ("dynamic_debug: add trim_prefix() to provide source-root relative paths")
> > commit a73619a845d5 ("kbuild: use -fmacro-prefix-map to make __FILE__ a relative path")
> >
> > 2nd commit broke dynamic-debug's "file $fullpath" query form, but
> > nobody noticed because 1st commit trimmed prefixes from control-file
> > output, so the click-copy-pasting of fullpaths into new queries had
> > ceased; that query form became unused.
> >
> > So remove the function and callers; its purpose was to strip the
> > prefix from __FILE__, which is now gone.
>
> I agree with the intent, but I wonder if this is premature. I mean, the
> -fmacro-prefix-map is only for gcc 8+, so this ends up printing the full
> paths when the compiler is just a little old (and the kernel was built
> out-of-tree).
>
> I don't think keeping the current workaround for a year or two more
> should hurt; when int skip = strlen(__FILE__) -
> strlen("lib/dynamic_debug.c"); evaluates to 0 (in-tree build, or build
> with new enough gcc), I'm pretty sure gcc optimizes the rest of the
> function away (it should know that strncmp(x, y, 0) gives 0, and even if
> it didn't, the conditional assigns 0 to skip which it already is, so gcc
> just needs to know that strncmp() is pure).
>
> >
> > Also drop "file $fullpath" from docs, and tweak example to cite column
> > 1 of control-file as valid "file $input".
>
> That part certainly makes sense, since the $fullpath hasn't actually
> been in the control file for a long time.
>
> Rasmus
>


I agree. Ive split the patch, am keeping the doc change.

\
 
 \ /
  Last update: 2019-11-01 17:21    [W:0.045 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site