lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 22 Jun 2015 19:37:45 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	Jiri Olsa <jolsa@...nel.org>, lkml <linux-kernel@...r.kernel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Andi Kleen <ak@...ux.intel.com>,
	David Ahern <dsahern@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 01/26] perf tools: Change thread_map::map into struct

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/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ