[PATCH] tracedump: Add tri-state --color option (auto, always, or never)

José Fonseca jose.r.fonseca at gmail.com
Tue Oct 25 11:26:37 PDT 2011


On Mon, Oct 24, 2011 at 10:00 PM, Carl Worth <cworth at cworth.org> wrote:
> On Mon, 24 Oct 2011 13:35:43 +0100, José Fonseca <jose.r.fonseca at gmail.com> wrote:
>> The formatter.hpp/trace_model.cpp code can be used with streams other
>> than stdout, as there's no standard way to get filenos out of C++
>> ostreams , so the autodetection is better done by the caller. I've
>> done that and commited.
>
> Thanks, that does look better.
>
> Next, I've got two commits which add the following:
>
>        1. A new apitrace program (with only "apitrace help")
>
>        2. A new "apitrace dump" command (replacing tracedump.cpp)
>
> These are available in the apitrace-dump branch of my repository:
>
>        git://git.cworth.org/git/apitrace
>
> Here are some of the differences since the first branch in which I
> proposed a new apitrace command:
>
>  * This branch is less aggressive in that it starts with a fairly
>    simple command, dump, rather than the trickier trace command. This
>    means no need for config.h changes, PATH manipulations, etc.
>
>  * There's no longer any use of talloc.
>
>  * The indentation is fixed to use only spaces, not TAB characters.[*]
>
>  * I've done some minimal testing of things with both an OSX machine as
>    well as cross-compilation with mingw32, (so I'm trying, but I won't
>    promise that I won't still make portability mistakes here and there).

Looks good to me. I agree that tackling the low hanging fruit first is best.

Just one request, please put each command on its separate .cpp file
(e.g., apitrace_dump), leaving apitrace.{cpp,hpp} for stuff shared by
all of them.

Furthermore, let's put all the command line commands in a "cli"
subdirectory, and put piece of functionality which can be shared with
the gui in a library -- maybe "common" for the time being.

> [*] To make this easy for me, (an emacs user), I've dropped the
> following content into a new file called .dir-locals.el in the top-level
> of the apitrace repository. If you'd like, we could add this file to the
> repository so that other emacs users would also get the right settings
> by default. And if there are any other style issues I'm still getting
> wrong, please let me know.
>
> ; emacs local configuration settings for apitrace source
>
> ((c-mode
>  (indent-tabs-mode . nil)
>  (c-basic-offset . 4)
>  (c-file-style . "linux"))
>  (c++-mode
>  (indent-tabs-mode . nil)
>  (c-basic-offset . 4)
>  (c-file-style . "linux"))
>  )
>

Zack added an .emacs-dirvars, but .emacs-dirvars looks to be more
non-standard compared to .dir-locals.el, which is supported by emacs
out of the box I believe.

I'm fine having both.

What does c-file-style "linux" achieve?

Jose


More information about the apitrace mailing list