From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932986AbcFBUfB (ORCPT ); Thu, 2 Jun 2016 16:35:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9657 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932171AbcFBUe7 (ORCPT ); Thu, 2 Jun 2016 16:34:59 -0400 Date: Thu, 2 Jun 2016 22:34:48 +0200 From: Jiri Olsa To: He Kuang Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, wangnan0@huawei.com, jpoimboe@redhat.com, ak@linux.intel.com, eranian@google.com, namhyung@kernel.org, adrian.hunter@intel.com, sukadev@linux.vnet.ibm.com, masami.hiramatsu.pt@hitachi.com, tumanova@linux.vnet.ibm.com, kan.liang@intel.com, penberg@kernel.org, dsahern@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 03/14] perf tools: Introducing struct unwind_libunwind_ops for local unwind Message-ID: <20160602203448.GD26647@krava> References: <1464861326-22677-1-git-send-email-hekuang@huawei.com> <1464861326-22677-4-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464861326-22677-4-git-send-email-hekuang@huawei.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 02 Jun 2016 20:34:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 02, 2016 at 09:55:15AM +0000, He Kuang wrote: SNIP > @@ -680,3 +680,52 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg, > > return get_entries(&ui, cb, arg, max_stack); > } > + > +static struct unwind_libunwind_ops > +_unwind_libunwind_ops = { > + .prepare_access = _unwind__prepare_access, > + .flush_access = _unwind__flush_access, > + .finish_access = _unwind__finish_access, > + .get_entries = _unwind__get_entries, > +}; > + > +struct unwind_libunwind_ops * > +local_unwind_libunwind_ops = &_unwind_libunwind_ops; > + > +void unwind__register_ops(struct thread *thread, > + struct unwind_libunwind_ops *ops) > +{ > + thread->unwind_libunwind_ops = ops; > +} no need for unwind__register_ops to be global please make it static jirka