From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752620AbbJLNf3 (ORCPT ); Mon, 12 Oct 2015 09:35:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45643 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752168AbbJLNf0 (ORCPT ); Mon, 12 Oct 2015 09:35:26 -0400 Date: Mon, 12 Oct 2015 15:35:20 +0200 From: Jiri Olsa To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , LKML , Frederic Weisbecker , Stephane Eranian , David Ahern , Andi Kleen Subject: Re: [RFC/PATCH 18/38] perf tools: Introduce thread__find_addr_location_by_time() and friends Message-ID: <20151012133520.GA16529@krava.brq.redhat.com> References: <1443763159-29098-1-git-send-email-namhyung@kernel.org> <1443763159-29098-19-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443763159-29098-19-git-send-email-namhyung@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 02, 2015 at 02:18:59PM +0900, Namhyung Kim wrote: SNIP > +void thread__find_addr_map(struct thread *thread, u8 cpumode, > + enum map_type type, u64 addr, > + struct addr_location *al) > +{ > + al->thread = thread; > + map_groups__find_addr_map(thread->mg, cpumode, type, addr, al); > +} > + > +void thread__find_addr_map_by_time(struct thread *thread, u8 cpumode, > + enum map_type type, u64 addr, > + struct addr_location *al, u64 timestamp) > +{ > + struct map_groups *mg; > + > + if (perf_has_index) > + mg = thread__get_map_groups(thread, timestamp); > + else > + mg = thread->mg; > + > + al->thread = thread; > + map_groups__find_addr_map(mg, cpumode, type, addr, al); > +} > + > void thread__find_addr_location(struct thread *thread, > u8 cpumode, enum map_type type, u64 addr, > struct addr_location *al) > @@ -985,6 +1006,23 @@ void thread__find_addr_location(struct thread *thread, > al->sym = NULL; > } > > +void thread__find_addr_location_by_time(struct thread *thread, u8 cpumode, > + enum map_type type, u64 addr, > + struct addr_location *al, u64 timestamp) > +{ > + if (perf_has_index) > + thread__find_addr_map_by_time(thread, cpumode, type, addr, al, > + timestamp); > + else > + thread__find_addr_map(thread, cpumode, type, addr, al); hum, we make the 'perf_has_index' decision here and also in thread__find_addr_map_by_time which seems to have the same code as thread__find_addr_map for !perf_has_index case it seems redundant to have both original and _by_time versions why not just thread__find_cpumode_addr_location with time arg? also how about other callers of original versions like thread__find_addr_location call in util/unwind-libunwind.c ? jirka