Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753048AbcDRNpt (ORCPT ); Mon, 18 Apr 2016 09:45:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44461 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752997AbcDRNps (ORCPT ); Mon, 18 Apr 2016 09:45:48 -0400 Date: Mon, 18 Apr 2016 15:45:44 +0200 From: Jiri Olsa To: Wang Nan Cc: acme@kernel.org, linux-kernel@vger.kernel.org, pi3orama@163.com, Adrian Hunter , He Kuang , Jiri Olsa , Masami Hiramatsu , Namhyung Kim , Zefan Li Subject: Re: [PATCH v4 1/6] perf tools: Derive trigger class from auxtrace_snapshot Message-ID: <20160418134544.GA13675@krava.brq.redhat.com> References: <1460961133-182746-1-git-send-email-wangnan0@huawei.com> <1460961133-182746-2-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460961133-182746-2-git-send-email-wangnan0@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 18 Apr 2016 13:45:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1414 Lines: 34 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 also the switch_output code does not seem to use this transition at all thanks, jirka