Re: [PATCH v3 1/6] perf tools: Derive trigger class from auxtrace_snapshot

From: Wangnan (F)
Date: Sun Apr 17 2016 - 22:33:35 EST

On 2016/4/17 19:50, Jiri Olsa wrote:
On Fri, Apr 15, 2016 at 06:20:15PM +0000, Wang Nan wrote:
Create a new class named 'trigger' to model the state of a trigger and
implement auxtrace_snapshot with it.

auxtrace_record__snapshot_started and auxtrace_snapshot_err are absorbed.

'trigger' defines 4 state transitioning functions ('on', 'released',
'toggle' and 'colddown') and 2 state query function ('is_released') and
('is_toggled'). The state 'ON' and 'OFF' take higher priority than
'RELEASED' and 'TOGGLED'. A trigger must be 'on' before 'enable' and
'disable' take effect. A trigger can be colddown after being triggered.
what's the COLDDOWN state for?

COLDDOWN is for auxtrace_record__snapshot_started. Once signal received,
auxtrace subsystem doesn't process following signal, until
record__read_auxtrace_snapshot finished successful. Mapping to trigger,
once the state of a trigger moves to 'TRIGGERED', there must be a state
neither RELEASED nor ERROR, which disallow triggering, but allow transiting

could you please document all the transitions of this state machine
in the change log and the trigger.h file?

Will do. Thank you.