From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758210AbcFAIji (ORCPT ); Wed, 1 Jun 2016 04:39:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52393 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757713AbcFAIjg (ORCPT ); Wed, 1 Jun 2016 04:39:36 -0400 Date: Wed, 1 Jun 2016 10:39:26 +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 v7 04/14] perf tools: Move unwind__prepare_access from thread_new into thread__insert_map Message-ID: <20160601083926.GB13738@krava> References: <1464693552-104294-1-git-send-email-hekuang@huawei.com> <1464693552-104294-5-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464693552-104294-5-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.29]); Wed, 01 Jun 2016 08:39:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 31, 2016 at 11:19:02AM +0000, He Kuang wrote: > For determine the libunwind methods to use, we should get the > 32bit/64bit information from maps of a thread. When a thread is newly > created, the information is not prepared. This patch moves > unwind__prepare_access() into thread__insert_map() so we can get the > information we need from maps. Meanwhile, let thread__insert_map() > return value and show messages on error. > > Signed-off-by: He Kuang > --- > tools/perf/util/machine.c | 10 ++++++++-- > tools/perf/util/thread.c | 13 +++---------- > tools/perf/util/thread.h | 2 +- > tools/perf/util/unwind-libunwind.c | 7 +++---- > 4 files changed, 15 insertions(+), 17 deletions(-) > > diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c > index bdc33ce..0bd6aac 100644 > --- a/tools/perf/util/machine.c > +++ b/tools/perf/util/machine.c > @@ -1353,7 +1353,10 @@ int machine__process_mmap2_event(struct machine *machine, > if (map == NULL) > goto out_problem_map; > > - thread__insert_map(thread, map); > + ret = thread__insert_map(thread, map); > + if (ret) > + pr_err("Thread insert map error\n"); > + I think we should fail the function, not just display error > thread__put(thread); > map__put(map); > return 0; > @@ -1403,7 +1406,10 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event > if (map == NULL) > goto out_problem_map; > > - thread__insert_map(thread, map); > + ret = thread__insert_map(thread, map); > + if (ret) > + pr_err("Thread insert map error\n"); same here jirka