All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts: override locale from environment when running recordmcount.pl
@ 2019-04-24 17:55 Daniel Dadap
  2019-04-27  6:55 ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Dadap @ 2019-04-24 17:55 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Daniel Dadap

recordmcount.pl uses a set of regular expressions to parse the output of
objdump(1). However, if objdump(1) output is localized, it may not match
the regular expressions, thereby preventing recordmcount.pl from parsing
object files correctly.

In order to allow recordmcount.pl to function correctly regardless of the
current locale settings, set LANG=C when running objdump(1). LC_ALL is
already unset in the top-level Makefile, so it is not necessary to also
override that environment variable.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
---
 scripts/recordmcount.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 68841d01162c..b7bcdc71e6e8 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -493,7 +493,7 @@ sub update_funcs
 #
 # Step 2: find the sections and mcount call sites
 #
-open(IN, "$objdump -hdr $inputfile|") || die "error running $objdump";
+open(IN, "env LANG=C $objdump -hdr $inputfile|") || die "error running $objdump";
 
 my $text;
 
-- 
2.18.1

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

* Re: [PATCH] scripts: override locale from environment when running recordmcount.pl
  2019-04-24 17:55 [PATCH] scripts: override locale from environment when running recordmcount.pl Daniel Dadap
@ 2019-04-27  6:55 ` Masahiro Yamada
  2019-04-27 15:08   ` Daniel Dadap
  0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2019-04-27  6:55 UTC (permalink / raw)
  To: Daniel Dadap; +Cc: Linux Kbuild mailing list

On Thu, Apr 25, 2019 at 2:56 AM Daniel Dadap <ddadap@nvidia.com> wrote:
>
> recordmcount.pl uses a set of regular expressions to parse the output of
> objdump(1). However, if objdump(1) output is localized, it may not match
> the regular expressions, thereby preventing recordmcount.pl from parsing
> object files correctly.
>
> In order to allow recordmcount.pl to function correctly regardless of the
> current locale settings, set LANG=C when running objdump(1). LC_ALL is
> already unset in the top-level Makefile, so it is not necessary to also
> override that environment variable.
>
> Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
> Reviewed-by: Robert Morell <rmorell@nvidia.com>
> ---
>  scripts/recordmcount.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
> index 68841d01162c..b7bcdc71e6e8 100755
> --- a/scripts/recordmcount.pl
> +++ b/scripts/recordmcount.pl
> @@ -493,7 +493,7 @@ sub update_funcs
>  #
>  # Step 2: find the sections and mcount call sites
>  #
> -open(IN, "$objdump -hdr $inputfile|") || die "error running $objdump";
> +open(IN, "env LANG=C $objdump -hdr $inputfile|") || die "error running $objdump";


Just to be consistent with the other places,
is 'env' necessary?

arch/powerpc/boot/wrapper:LANG=C elfformat="`${CROSS}objdump -p
"$kernel" | grep 'file format' | awk '{print $4}'`"
scripts/tags.sh:    LANG=C sed -i -e
'/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1
tools/testing/selftests/rcutorture/bin/config2frag.sh:LANG=C sed -e
's/^# CONFIG_\([a-zA-Z0-9_]*\) is not set$/CONFIG_\1=n/'


>  my $text;
>
> --
> 2.18.1
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] scripts: override locale from environment when running recordmcount.pl
  2019-04-27  6:55 ` Masahiro Yamada
@ 2019-04-27 15:08   ` Daniel Dadap
  2019-04-27 15:21     ` [PATCH v2] " Daniel Dadap
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Dadap @ 2019-04-27 15:08 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kbuild mailing list

On 4/27/19 1:55 AM, Masahiro Yamada wrote:
> On Thu, Apr 25, 2019 at 2:56 AM Daniel Dadap <ddadap@nvidia.com> wrote:
>> recordmcount.pl uses a set of regular expressions to parse the output of
>> objdump(1). However, if objdump(1) output is localized, it may not match
>> the regular expressions, thereby preventing recordmcount.pl from parsing
>> object files correctly.
>>
>> In order to allow recordmcount.pl to function correctly regardless of the
>> current locale settings, set LANG=C when running objdump(1). LC_ALL is
>> already unset in the top-level Makefile, so it is not necessary to also
>> override that environment variable.
>>
>> Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
>> Reviewed-by: Robert Morell <rmorell@nvidia.com>
>> ---
>>   scripts/recordmcount.pl | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
>> index 68841d01162c..b7bcdc71e6e8 100755
>> --- a/scripts/recordmcount.pl
>> +++ b/scripts/recordmcount.pl
>> @@ -493,7 +493,7 @@ sub update_funcs
>>   #
>>   # Step 2: find the sections and mcount call sites
>>   #
>> -open(IN, "$objdump -hdr $inputfile|") || die "error running $objdump";
>> +open(IN, "env LANG=C $objdump -hdr $inputfile|") || die "error running $objdump";
>
> Just to be consistent with the other places,
> is 'env' necessary?
>
> arch/powerpc/boot/wrapper:LANG=C elfformat="`${CROSS}objdump -p
> "$kernel" | grep 'file format' | awk '{print $4}'`"
> scripts/tags.sh:    LANG=C sed -i -e
> '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1
> tools/testing/selftests/rcutorture/bin/config2frag.sh:LANG=C sed -e
> 's/^# CONFIG_\([a-zA-Z0-9_]*\) is not set$/CONFIG_\1=n/'


It's probably not strictly necessary; the 'env' is there in case of a 
shell that doesn't allow setting environment variables on the command 
line like that, but if Kbuild already presumes a shell that does allow 
it, I'm happy to send a v2 that omits the 'env'.


>
>>   my $text;
>>
>> --
>> 2.18.1
>>
>

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

* [PATCH v2] scripts: override locale from environment when running recordmcount.pl
  2019-04-27 15:08   ` Daniel Dadap
@ 2019-04-27 15:21     ` Daniel Dadap
  2019-04-28  1:34       ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Dadap @ 2019-04-27 15:21 UTC (permalink / raw)
  To: linux-kbuild, yamada.masahiro; +Cc: Daniel Dadap

recordmcount.pl uses a set of regular expressions to parse the output of
objdump(1). However, if objdump(1) output is localized, it may not match
the regular expressions, thereby preventing recordmcount.pl from parsing
object files correctly.

In order to allow recordmcount.pl to function correctly regardless of the
current locale settings, set LANG=C when running objdump(1). LC_ALL is
already unset in the top-level Makefile, so it is not necessary to also
override that environment variable.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
---
 scripts/recordmcount.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 68841d01162c..ffea46287f83 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -493,7 +493,7 @@ sub update_funcs
 #
 # Step 2: find the sections and mcount call sites
 #
-open(IN, "$objdump -hdr $inputfile|") || die "error running $objdump";
+open(IN, "LANG=C $objdump -hdr $inputfile|") || die "error running $objdump";
 
 my $text;
 
-- 
2.18.1

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

* Re: [PATCH v2] scripts: override locale from environment when running recordmcount.pl
  2019-04-27 15:21     ` [PATCH v2] " Daniel Dadap
@ 2019-04-28  1:34       ` Masahiro Yamada
  0 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2019-04-28  1:34 UTC (permalink / raw)
  To: Daniel Dadap; +Cc: Linux Kbuild mailing list

On Sun, Apr 28, 2019 at 12:23 AM Daniel Dadap <ddadap@nvidia.com> wrote:
>
> recordmcount.pl uses a set of regular expressions to parse the output of
> objdump(1). However, if objdump(1) output is localized, it may not match
> the regular expressions, thereby preventing recordmcount.pl from parsing
> object files correctly.
>
> In order to allow recordmcount.pl to function correctly regardless of the
> current locale settings, set LANG=C when running objdump(1). LC_ALL is
> already unset in the top-level Makefile, so it is not necessary to also
> override that environment variable.
>
> Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
> Reviewed-by: Robert Morell <rmorell@nvidia.com>


Applied to linux-kbuild.
Thanks.

> ---
>  scripts/recordmcount.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
> index 68841d01162c..ffea46287f83 100755
> --- a/scripts/recordmcount.pl
> +++ b/scripts/recordmcount.pl
> @@ -493,7 +493,7 @@ sub update_funcs
>  #
>  # Step 2: find the sections and mcount call sites
>  #
> -open(IN, "$objdump -hdr $inputfile|") || die "error running $objdump";
> +open(IN, "LANG=C $objdump -hdr $inputfile|") || die "error running $objdump";
>
>  my $text;
>
> --
> 2.18.1
>


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2019-04-28  1:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-24 17:55 [PATCH] scripts: override locale from environment when running recordmcount.pl Daniel Dadap
2019-04-27  6:55 ` Masahiro Yamada
2019-04-27 15:08   ` Daniel Dadap
2019-04-27 15:21     ` [PATCH v2] " Daniel Dadap
2019-04-28  1:34       ` Masahiro Yamada

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.