lkml.org 
[lkml]   [2016]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v7 10/14] perf tools: Check the target platform before assigning unwind methods
    On Tue, May 31, 2016 at 11:19:08AM +0000, He Kuang wrote:

    SNIP

    > -int unwind__prepare_access(struct thread *thread)
    > +int unwind__prepare_access(struct thread *thread, struct map *map)
    > {
    > - unwind__register_ops(thread, local_unwind_libunwind_ops);
    > + const char *arch;
    > + enum dso_type dso_type;
    > + struct unwind_libunwind_ops *ops = local_unwind_libunwind_ops;
    >
    > - return thread->unwind_libunwind_ops->prepare_access(thread);
    > + if (!thread->mg->machine->env)
    > + return 0;
    > +
    > + dso_type = dso__type(map->dso, thread->mg->machine);
    > + if (dso_type == DSO__TYPE_UNKNOWN)
    > + return 0;
    > +
    > + if (thread->addr_space)
    > + pr_debug("unwind: thread map already set, 64bit is %d, dso=%s\n",
    > + dso_type == DSO__TYPE_64BIT, map->dso->name);
    > +
    > + arch = normalize_arch(thread->mg->machine->env->arch);
    > + pr_debug("unwind: target platform=%s\n", arch);
    > +
    > + unwind__register_ops(thread, ops);
    > +
    > + if (thread->unwind_libunwind_ops)
    > + return thread->unwind_libunwind_ops->prepare_access(thread);
    > + else
    > + return 0;

    why do you need to check for thread->unwind_libunwind_ops != NULL?
    it's all set at this point right?

    jirka

    \
     
     \ /
      Last update: 2016-06-01 11:01    [W:4.093 / U:0.220 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site