From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752949AbbFVRiE (ORCPT ); Mon, 22 Jun 2015 13:38:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50194 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752048AbbFVRhx (ORCPT ); Mon, 22 Jun 2015 13:37:53 -0400 Date: Mon, 22 Jun 2015 19:37:45 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , lkml , Adrian Hunter , Andi Kleen , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra , Stephane Eranian Subject: Re: [PATCH 01/26] perf tools: Change thread_map::map into struct Message-ID: <20150622173745.GA749@krava.redhat.com> References: <1434664145-26951-1-git-send-email-jolsa@kernel.org> <1434664145-26951-2-git-send-email-jolsa@kernel.org> <20150619210713.GA28405@kernel.org> <20150619220531.GA1389@krava.redhat.com> <20150622144016.GC13937@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150622144016.GC13937@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 22, 2015 at 11:40:16AM -0300, Arnaldo Carvalho de Melo wrote: SNIP > > > > +++ b/tools/perf/tests/openat-syscall-tp-fields.c > > > > @@ -45,7 +45,7 @@ int test__syscall_openat_tp_fields(void) > > > > > > > > perf_evsel__config(evsel, &opts); > > > > > > > > - evlist->threads->map[0] = getpid(); > > > > + thread_map__pid(evlist->threads, 0) = getpid(); > > > > > > So this 'function(parms) = something' idiom looks ugly/unfamiliar, can't > > > we keep using: > > > > > > evlist->thread->map[0].pid = getpid(); > > > > hum, I like it more than above line.. what's ugly about that assignment? > > > > I'm adding thread_map__comm to access new 'comm' member, > > so I wanted to introduce easy accessors for both members > > > > get/set functions seem like overkill.. we could use upper case to state > > that it's a macro: > > > > THREAD_MAP__PID(evlist->threads, 0) = getpid(); > > > > anyway I can keep the original way if you insist ;-) > > I really think that > > foo(a, b, c) = bla; > > is ugly :-\ > > *foo(a, b, c) = bla; > > Is uglier tho, bored right now to go beyond aesthetics tho :-\ discussed on irc and decided to go with: thread_map__pid(threads, i) // to get pid thread_map__set_pid(threads, i, pid) // to set pid thread_map__comm(threads, i) // to get comm thread_map__set_comm(threads, i, comm) // to set comm jirka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/