linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts/tags.sh: Add magic for OFFSET and DEFINE
@ 2013-03-23 10:58 Kirill Tkhai
  2013-03-26 21:35 ` Michal Marek
  0 siblings, 1 reply; 4+ messages in thread
From: Kirill Tkhai @ 2013-03-23 10:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Michal Marek, Andrew Morton

Add rules for definitions which is generally used in asm-offsets files.

Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
CC: Michal Marek <mmarek@suse.cz>
CC: Andrew Morton <akpm@linux-foundation.org>
---
 scripts/tags.sh |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 26a87e6..74f02e4 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -199,7 +199,9 @@ exuberant()
 	--regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \
 	--regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/'		\
 	--regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/'	\
-	--regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/'
+	--regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/'		\
+	--regex-c='/(^\s)OFFSET\((\w*)/\2/v/'				\
+	--regex-c='/(^\s)DEFINE\((\w*)/\2/v/'
 
 	all_kconfigs | xargs $1 -a                              \
 	--langdef=kconfig --language-force=kconfig              \

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

* Re: [PATCH] scripts/tags.sh: Add magic for OFFSET and DEFINE
  2013-03-23 10:58 [PATCH] scripts/tags.sh: Add magic for OFFSET and DEFINE Kirill Tkhai
@ 2013-03-26 21:35 ` Michal Marek
  2013-03-27 11:59   ` Kirill Tkhai
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Marek @ 2013-03-26 21:35 UTC (permalink / raw)
  To: Kirill Tkhai; +Cc: linux-kernel, Andrew Morton

On Sat, Mar 23, 2013 at 02:58:20PM +0400, Kirill Tkhai wrote:
> Add rules for definitions which is generally used in asm-offsets files.
> 
> Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
> CC: Michal Marek <mmarek@suse.cz>
> CC: Andrew Morton <akpm@linux-foundation.org>
> ---
>  scripts/tags.sh |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> diff --git a/scripts/tags.sh b/scripts/tags.sh
> index 26a87e6..74f02e4 100755
> --- a/scripts/tags.sh
> +++ b/scripts/tags.sh
> @@ -199,7 +199,9 @@ exuberant()
>  	--regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \
>  	--regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/'		\
>  	--regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/'	\
> -	--regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/'
> +	--regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/'		\
> +	--regex-c='/(^\s)OFFSET\((\w*)/\2/v/'				\
> +	--regex-c='/(^\s)DEFINE\((\w*)/\2/v/'

The macro definitions in the asm-offsets.h file are ammended with a
comment explaining what the value actually means. So you see both the
value and the semantic of the macro:

#define TI_flags 16 /* offsetof(struct thread_info, flags)      # */


By jumping to the asm-offset.c file instead, you would get only a subset
of that information.

OFFSET(TI_flags, thread_info, flags);

Unless I'm missing something, I don't think that this patch improves
much.

Michal

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

* Re: [PATCH] scripts/tags.sh: Add magic for OFFSET and DEFINE
  2013-03-26 21:35 ` Michal Marek
@ 2013-03-27 11:59   ` Kirill Tkhai
  2013-03-27 13:29     ` Michal Marek
  0 siblings, 1 reply; 4+ messages in thread
From: Kirill Tkhai @ 2013-03-27 11:59 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kernel, Andrew Morton



27.03.2013, 01:35, "Michal Marek" <mmarek@suse.cz>:
> On Sat, Mar 23, 2013 at 02:58:20PM +0400, Kirill Tkhai wrote:
>
>>  Add rules for definitions which is generally used in asm-offsets files.
>>
>>  Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
>>  CC: Michal Marek <mmarek@suse.cz>
>>  CC: Andrew Morton <akpm@linux-foundation.org>
>>  ---
>>   scripts/tags.sh |    4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>  diff --git a/scripts/tags.sh b/scripts/tags.sh
>>  index 26a87e6..74f02e4 100755
>>  --- a/scripts/tags.sh
>>  +++ b/scripts/tags.sh
>>  @@ -199,7 +199,9 @@ exuberant()
>>           --regex-c='/DEFINE_PER_CPU_SHARED_ALIGNED\(([^,]*,\s*)(\w*).*\)/\2/v/' \
>>           --regex-c='/DECLARE_WAIT_QUEUE_HEAD\((\w*)/\1/v/' \
>>           --regex-c='/DECLARE_(TASKLET|WORK|DELAYED_WORK)\((\w*)/\2/v/' \
>>  - --regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/'
>>  + --regex-c='/DEFINE_PCI_DEVICE_TABLE\((\w*)/\1/v/' \
>>  + --regex-c='/(^\s)OFFSET\((\w*)/\2/v/' \
>>  + --regex-c='/(^\s)DEFINE\((\w*)/\2/v/'
>
> The macro definitions in the asm-offsets.h file are ammended with a
> comment explaining what the value actually means. So you see both the
> value and the semantic of the macro:
>
> #define TI_flags 16 /* offsetof(struct thread_info, flags)      # */
>
> By jumping to the asm-offset.c file instead, you would get only a subset
> of that information.
>
> OFFSET(TI_flags, thread_info, flags);
>
> Unless I'm missing something, I don't think that this patch improves
> much.

This patch does not annul definitions in asm-offsets.h. They stay still on their places.
It adds OFFSETs and DEFINEs from asm-offsets.c files.

When kernel is not precompiled you do not have asm-offsets.h and you are not
able to see what is the place offsets are defined for yor architecture.

Also, you are not able to look at other architectures because they do not have
precompiled asm-offsets.h.

I use ALLSOURCE_ARCHS=`ls arch/ | grep -v Kconfig` make tags to generate tags.
I thing some people do the same and sometimes they need offsets for another
architectures.

Kirill

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

* Re: [PATCH] scripts/tags.sh: Add magic for OFFSET and DEFINE
  2013-03-27 11:59   ` Kirill Tkhai
@ 2013-03-27 13:29     ` Michal Marek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Marek @ 2013-03-27 13:29 UTC (permalink / raw)
  To: Kirill Tkhai; +Cc: linux-kernel, Andrew Morton

On 27.3.2013 12:59, Kirill Tkhai wrote:
> 27.03.2013, 01:35, "Michal Marek" <mmarek@suse.cz>:
>> The macro definitions in the asm-offsets.h file are ammended with a
>> comment explaining what the value actually means. So you see both the
>> value and the semantic of the macro:
>>
>> #define TI_flags 16 /* offsetof(struct thread_info, flags)      # */
>>
>> By jumping to the asm-offset.c file instead, you would get only a subset
>> of that information.
>>
>> OFFSET(TI_flags, thread_info, flags);
>>
>> Unless I'm missing something, I don't think that this patch improves
>> much.
> 
> This patch does not annul definitions in asm-offsets.h. They stay still on their places.
> It adds OFFSETs and DEFINEs from asm-offsets.c files.
> 
> When kernel is not precompiled you do not have asm-offsets.h and you are not
> able to see what is the place offsets are defined for yor architecture.
> 
> Also, you are not able to look at other architectures because they do not have
> precompiled asm-offsets.h.

I see, these are valid use cases for the regexps. I applied your patch
to kbuild.git#misc now.

Michal

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

end of thread, other threads:[~2013-03-27 13:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-23 10:58 [PATCH] scripts/tags.sh: Add magic for OFFSET and DEFINE Kirill Tkhai
2013-03-26 21:35 ` Michal Marek
2013-03-27 11:59   ` Kirill Tkhai
2013-03-27 13:29     ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).