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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 3 Oct 2008 13:12:09 +0200
From:	"stephane eranian" <eranian@...glemail.com>
To:	"David Gibson" <david@...son.dropbear.id.au>, eranian@...il.com,
	linux-kernel@...r.kernel.org
Cc:	perfmon2-devel <perfmon2-devel@...ts.sourceforge.net>
Subject: Re: perfmon3 interface overview

David,
>> [snip]
>> > III) attaching and detaching
>> >
>> >   With v2.81:
>> >      int pfm_load_context(int fd, pfarg_load_t *load);
>> >      int pfm_unload_context(int fd);
>> >
>> >   With v3.0:
>> >      int pfm_attach_session(int fd, int flags, int target);
>> >      int pfm_detach_session(int fd, int flags);
>>
>> Couldn't you get rid of one more syscall here by making detach a
>> special case of attach with a special "null" value for target, or a
>> special flag?
>
>
>  We could combine the two and use the flag field to indicate attach/detach.
>  The target is not a pointer but an int. Some people suggested I use an
>  unsigned long instead. In anycase, we could not use 0 to indicate "detach"
>  because CPU0 is a valid choice for system-wide. Thus we would have to
>  pick another value to mean "nothing", e.g, -1.
>
>  >  IV) starting and stopping
>  >
>  >    With v2.81:
>  >       int pfm_start(int fd, pfarg_start_t *st);
>  >       int pfm_stop(int fd);
>  >       int pfm_restart(int fd);
>  >
>  >    With v3.0:
>  >       int pfm_start_session(int fd, int flags);
>  >       int pfm_stop_session(int fd, int flags);
>
>> Likewise, couldn't you cut this down by one more syscall by making it
>>        int pfm_set_session_state(int fd, int flags);
>> and having a 'RUNNING' flag, which selects start or stop behaviour?
>
>  That one we can certainly do. That's a good idea.

Some more thoughts on this.

If we wanted to go even further, we could combine start/stop, attach/detach
into  a single syscall:

   int pfm_control_session(int fd, int flags, int target);
   With flags:
       PFM_CTFL_START  : start monitoring
       PFM_CTFL_STOP    : stop monitoring
       PFM_CTFL_RESTART: resume after overflow notification

       PFM_CTFL_ATTACH: attach to thread or cpu designated by 'target'
       PFM_CTFL_DETACH: detach session

But then, this is a form of ioctl() which people don't like....
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ