Re: [PATCH] dissect: introduce sym_is_local() for reporter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 11, 2020 at 05:01:36PM +0100, Oleg Nesterov wrote:
> Can be used to filter out the usage of local variables.

...
 
> diff --git a/dissect.h b/dissect.h
> index efe2c0b..178dba5 100644
> --- a/dissect.h
> +++ b/dissect.h
> @@ -27,6 +27,11 @@ struct reporter
>  
>  extern struct symbol *dissect_ctx;
>  
> +static inline bool sym_is_local(struct symbol *sym)
> +{
> +	return sym->kind == 'v' && !(sym->ctype.modifiers & MOD_TOPLEVEL);
> +}
> +

Shouldn't MOD_STATIC be added to the test?
It depends on what exactly you want for 'local'.

-- Luc



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux