Re: RFP: Fixing "-ga -ag -g fp -g dwarf" was Re: [PATCHSET 0/8] perftools: Fix scalability problem on callchain merging (v5)

From: David Ahern
Date: Fri Oct 25 2013 - 15:22:37 EST


On 10/25/13 1:09 PM, Arnaldo Carvalho de Melo wrote:
I think I did with the second follow up patch: -ga -ag -g fp -g
dwarf should all work properly with fp the default for -g.

Acked-by: Ingo Molnar <mingo@xxxxxxxxxx>

Can I have this one submitted?

I guess I found it but it was malformed, didn't apply.

Upon further review, Jiri was correct: that patch handles some of the old cases fine, but did not handle others. ie., it just moved the bad syntax problem around.

Looks like the parse-options code does not handle optional arguments. e.g., -g defaults to 'fp' if no argument is given. With the following permutations:
-gfoo
-g foo
-g -- foo

the parsing code gets confused on what 'foo' is. It needs some logic for callbacks to say 'nope, not my argument' and the option parsing checks for an alternative interpretation (e.g., "-gfoo" ?= "-f -o -o" or in the case of '-g foo' it means -g is the end of the arguments and foo is the first one not processed -- ie., the workload to run).

David

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/