From patchwork Sat Apr 27 09:16:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Dachary X-Patchwork-Id: 2496911 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 153DD3FC64 for ; Sat, 27 Apr 2013 09:16:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754663Ab3D0JQ1 (ORCPT ); Sat, 27 Apr 2013 05:16:27 -0400 Received: from smtp.dmail.dachary.org ([86.65.39.20]:54252 "EHLO smtp.dmail.dachary.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754356Ab3D0JQ0 (ORCPT ); Sat, 27 Apr 2013 05:16:26 -0400 Received: by smtp.dmail.dachary.org (Postfix, from userid 65534) id 804D426399; Sat, 27 Apr 2013 11:16:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on dmail.dachary.vm.gnt X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.5 Received: from [10.8.0.50] (unknown [10.8.0.50]) by smtp.dmail.dachary.org (Postfix) with ESMTPS id DE1A826395; Sat, 27 Apr 2013 11:16:22 +0200 (CEST) Message-ID: <517B9766.3060409@dachary.org> Date: Sat, 27 Apr 2013 11:16:22 +0200 From: Loic Dachary Organization: Artisan Logiciel Libre User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11 MIME-Version: 1.0 To: Samuel Just CC: Ceph Development Subject: Re: PG statechart References: <517A9B3A.3080806@dachary.org> <281AE624-F6F6-4376-8130-77608D174646@inktank.com> <517B523D.8000503@dachary.org> In-Reply-To: X-Enigmail-Version: 1.4 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Hi Sam, I missed this one, thanks for the link :-) It is also a little easier because http://rtime.felk.cvut.cz/statechart-viewer/ complains about missing react for NullEvt and requires the following hack to work Cheers On 04/27/2013 10:08 AM, Samuel Just wrote: > There is actually a peering state diagram generated with the docs: > http://ceph.com/docs/master/dev/peering/ > > Unfortunately, the image comes out rather small, you can generate it > for yourself with the script at doc/scripts/gen_state_diagram.py. >>From admin/build_doc: > > cat src/osd/PG.h src/osd/PG.cc | doc/scripts/gen_state_diagram.py > > doc/dev/peering_graph.generated.dot > > It's similar to the boost generated one, but also includes most of the > state transitions from within the custom_reaction state chart > reactions. > -Sam > > On Fri, Apr 26, 2013 at 9:49 PM, Noah Watkins wrote: >> Very cool! >> >> On Apr 26, 2013, at 9:21 PM, Loic Dachary wrote: >> >>> Hi Noah, >>> >>> Nice tool :-) Here is the statechart generated from PG.h. >>> >>> Cheers >>> >>> On 04/26/2013 06:07 PM, Noah Watkins wrote: >>>> Boost Statechart Viewer generates GraphViz: >>>> >>>> http://rtime.felk.cvut.cz/statechart-viewer/ >>>> >>>> Having trouble with my LLVM environment on 12.04, so I haven't tested it. >>>> >>>> -Noah >>>> >>>> On Apr 26, 2013, at 8:20 AM, Loic Dachary wrote: >>>> >>>>> Hi, >>>>> >>>>> I was considering drawing a statechart ( http://www.math-cs.gordon.edu/courses/cs211/ATMExample/SessionStatechart.gif ) to better understand the transitions of PG >>>>> >>>>> https://github.com/ceph/ceph/blob/master/src/osd/PG.h#L1341 >>>>> >>>>> and realized that it probably already exists somewhere. Does it ? >>>>> >>>>> /me hopefull ;-) >>>>> >>>>> -- >>>>> Lo?c Dachary, Artisan Logiciel Libre >>>>> >>>> >>> >>> -- >>> Lo?c Dachary, Artisan Logiciel Libre >>> >> >> -- >> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > To unsubscribe from this list: send the line "unsubscribe ceph-devel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/osd/PG.h b/src/osd/PG.h index 578afd3..f6446a9 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1332,6 +1332,7 @@ public: boost::statechart::result react(const Load&); boost::statechart::result react(const MNotifyRec&); boost::statechart::result react(const MInfoRec&); + boost::statechart::result react(const NullEvt&); boost::statechart::result react(const MLogRec&); boost::statechart::result react(const boost::statechart::event_base&) { return discard_event(); @@ -1353,6 +1354,7 @@ public: boost::statechart::result react(const QueryState& q); boost::statechart::result react(const AdvMap&); boost::statechart::result react(const ActMap&); + boost::statechart::result react(const NullEvt&); boost::statechart::result react(const FlushedEvt&); boost::statechart::result react(const boost::statechart::event_base&) { return discard_event(); @@ -1374,6 +1376,7 @@ public: > reactions; boost::statechart::result react(const QueryState& q); boost::statechart::result react(const AdvMap&); + boost::statechart::result react(const NullEvt&); boost::statechart::result react(const FlushedEvt&); boost::statechart::result react(const boost::statechart::event_base&) { return discard_event();