lkml.org 
[lkml]   [2015]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/14] perf tools: Use kmod_path__parse in map_groups__set_modules_path_dir
On Mon, Mar 23, 2015 at 08:55:09AM +0900, Namhyung Kim wrote:

SNIP

> > > + */
> > > + if (m->comp && is_kmod_dso(map->dso))
> > > + map->dso->symtab_type++;
> >
> > Ouch, does this assumes this is a:
> >
> > DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE
>
> Nope, it's one of _SYSTEM_PATH_KMODULE or _GUEST_KMODULE.
>
>
> >
> > And that, because in the dso_binary_type enum
> > DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP comes right after it, and thus
> > this cryptic increment is equivalent to:
> >
> > map->dso->symtab_type = DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP;
>
> Again, _SYSTEM_PATH_KMODULE_COMP or _GUEST_KMODULE_COMP.
>

yep, the code assumes (correctly) that symtab_type is
either _SYSTEM_PATH_KMODULE or _GUEST_KMODULE.

Namhyung placed the _COMP enum right behind 'no comp' values:

enum dso_binary_type {
...
DSO_BINARY_TYPE__GUEST_KMODULE,
DSO_BINARY_TYPE__GUEST_KMODULE_COMP,
DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE,
DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP,
...

so we could safely just increase the symtab_type in case
we detect it's compressed kernel module.

Perhaps the code could be more verbose on this, but since such
comment wasn't part of the previous code I did not feel the need
to add it now ;-)

jirka


\
 
 \ /
  Last update: 2015-03-23 12:21    [W:0.065 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site