lkml.org 
[lkml]   [2016]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 1/6] perf tools: Derive trigger class from auxtrace_snapshot
From
Date


On 2016/4/18 21:45, Jiri Olsa wrote:
> On Mon, Apr 18, 2016 at 06:32:08AM +0000, Wang Nan wrote:
>> Use 'trigger' to model operations which need to be executed when
>> an event (a signal, for example) is observed.
>>
>> States and transits:
>>
>> OFF--(on)--> READY --(toggle)--> TOGGLED --(process)--> PROCESSING
>> ^ | |
>> | | |
>> | (ready) (ready)
>> | | |
>> \__________________/______________________/
>>
>> is_toggled and is_ready are two key functions to query the state of
>> a trigger. is_toggled means the event already happen; is_ready means the
>> trigger is waiting for the event.
>>
>> 'PROCESSING' represents a state the event happens and be observed, and
>> the processing is on the way so can't accept a new event immediately.
> hum, I must be missing something.. but I dont see how you're
> using this state except for smal window within:
>
> if (auxtrace_snapshot_is_toggled()) {
> -> auxtrace_snapshot_process();
> if (!auxtrace_snapshot_is_error())
> -> record__read_auxtrace_snapshot(rec);
>
> but no other place queries or depends on this state

Right.

Since we are creating a new class, I think we can make code simpler by
merging
all state variables into trigger.

Without this state we must keep 'auxtrace_record__snapshot_started'.

I think merging it into trigger class makes the whole program a little
bit simpler. Or do you think keeping trigger class simpler whould be better?

Thank you.


\
 
 \ /
  Last update: 2016-04-18 16:41    [W:0.071 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site