Re: [tip:perf/core] perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR()
- From
Erik Faye-Lund <kusmabite@googlemail.com>
- Date
- Apr 14, 2010, 15:12 UTC
- Message-ID
- <j2k40aa078e1004140812s3d9fab4auf559b1e87af60b5b@mail.gmail.com>
- In-Reply-To
- <tip-c05556421742eb47f80301767653a4bcb19de9de@git.kernel.org>
I'd just like to point out that I'm commenting from the Git pont-of-view, since this patch was CC'ed to the Git mailing-list.
On Wed, Apr 14, 2010 at 11:36 AM, tip-bot for Ian Munsie <imunsie@au.ibm.com> wrote:
Show 13 quoted lines
> Commit-ID: c05556421742eb47f80301767653a4bcb19de9de > Gitweb: http://git.kernel.org/tip/c05556421742eb47f80301767653a4bcb19de9de > Author: Ian Munsie <imunsie@au.ibm.com> > AuthorDate: Tue, 13 Apr 2010 18:37:33 +1000 > Committer: Ingo Molnar <mingo@elte.hu> > CommitDate: Wed, 14 Apr 2010 11:26:44 +0200 > > perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() > > Parsing an option from the command line with OPT_BOOLEAN on a > bool data type would not work on a big-endian machine due to the > manner in which the boolean was being cast into an int and > incremented.
We don't use C99 features like the "bool"-type in Git, so this shouldn't really be a problem in our end.
Show 5 quoted lines
> For example, running 'perf probe --list' on a > PowerPC machine would fail to properly set the list_events bool > and would therefore print out the usage information and > terminate. >
I don't know what this 'perf'-thing is, but it sounds like it's some external client for the parse-options-API that uses OPT_BOOLEAN incorrectly.
Looking at linux-next.git, it seems so. The code in tools/perf/ seems to use OPT_BOOLEAN with C99 bools, and it seems to have imported git's parse-options API (in commit 0780060124011b94af55830939c86cc0916be0f5, it seems).
I'd suggest either fixing the call-sites to use int, or just keeping these changes in linux-next.git.
-- Erik "kusma" Faye-Lund