From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 3/3 v3] writeback: Add writeback stats for pages written Date: Wed, 31 Aug 2011 00:24:49 +0200 Message-ID: <20110830222449.GJ16202@quack.suse.cz> References: <1314038327-22645-1-git-send-email-curtw@google.com> <1314038327-22645-3-git-send-email-curtw@google.com> <20110829163645.GG5672@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Jan Kara , Christoph Hellwig , Wu Fengguang , Andrew Morton , Dave Chinner , Michael Rubin , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org To: Curt Wohlgemuth Return-path: Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Tue 30-08-11 11:13:50, Curt Wohlgemuth wrote: > Hi Jan: >=20 > >> +static const char *wb_stats_labels[WB_REASON_MAX] =3D { > >> + =A0 =A0 [WB_REASON_BALANCE_DIRTY] =3D "page: balance_dirty_pages", > >> + =A0 =A0 [WB_REASON_BACKGROUND] =3D "page: background_writeout", > >> + =A0 =A0 [WB_REASON_TRY_TO_FREE_PAGES] =3D "page: try_to_free_pages= ", > >> + =A0 =A0 [WB_REASON_SYNC] =3D "page: sync", > >> + =A0 =A0 [WB_REASON_PERIODIC] =3D "page: periodic", > >> + =A0 =A0 [WB_REASON_FDATAWRITE] =3D "page: fdatawrite", > >> + =A0 =A0 [WB_REASON_LAPTOP_TIMER] =3D "page: laptop_periodic", > >> + =A0 =A0 [WB_REASON_FREE_MORE_MEM] =3D "page: free_more_memory", > >> + =A0 =A0 [WB_REASON_FS_FREE_SPACE] =3D "page: fs_free_space", > >> +}; > > =A0I don't think it's good to have two enum->string translation table= s for > > reasons. That's prone to errors which is in fact proven by the fact t= hat > > you ommitted FORKER_THREAD reason here. >=20 > Ah, thanks for catching the omitted reason. I assume you mean the > table above, and >=20 > +#define show_work_reason(reason) >=20 > from the patch 2/3 (in the trace events file). Hmm, that could be a > challenge, given the limitations on what you can do in trace macros. > I'll think on this though. Ah right, with trace points it's not so simple. I guess we could have an array with labels as a global symbol and dereference it in tracepoints= . Honza --=20 Jan Kara SUSE Labs, CR -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter= .ca/ Don't email: email@kvack.org