[waffle] [PATCH] waffle utils: add wflinfo utility

Jordan Justen jljusten at gmail.com
Fri Dec 20 16:56:54 PST 2013


On Fri, Dec 20, 2013 at 2:31 PM, Chad Versace
<chad.versace at linux.intel.com> wrote:
> On 12/19/2013 11:31 AM, Jordan Justen wrote:
>> diff --git a/src/utils/Android.mk b/src/utils/Android.mk
>> new file mode 100644
>> index 0000000..4bb067f
>> --- /dev/null
>> +++ b/src/utils/Android.mk
>> @@ -0,0 +1,20 @@
>> +LOCAL_PATH:= $(call my-dir)
>> +include $(CLEAR_VARS)
>> +
>> +LOCAL_MODULE_TAGS := eng
>> +LOCAL_MODULE:= wflinfo
>> +
>> +LOCAL_CFLAGS:= \
>> +        -DANDROID_STUB \
>> +        -DWAFFLE_HAS_ANDROID \
>> +        -std=c99 \
>> +
>> +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include/waffle/
>> +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../src/waffle/
>
>
> The headers inside src/waffle are private to libwaffle. Only the headers
> in include/waffle are public. So src/waffle should be removed from the
> INCLUDES path.

This came from examples/Android.mk.

I wouldn't think that the examples should require internal waffle
includes, right?

> Did you test this on Android? If so, which lunch target and Android version?

No, sorry. I just stole from examples/Android.mk and made an effort to
make it look right. I'll separate it into a different patch.

>> diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
>> new file mode 100644
>> index 0000000..8b7f13b
>> --- /dev/null
>> +++ b/src/utils/wflinfo.c
>> @@ -0,0 +1,642 @@

>> +
>> +    glGetIntegerv(GL_NUM_EXTENSIONS, &count);
>> +
>> +    printf("OpenGL extensions:\n");
>> +    for (i = 0; i < count; i++) {
>> +        ext = (const char *) glGetStringi(GL_EXTENSIONS, i);
>> +        printf("%s%s", ext, (i + 1) < count ? " " : "");
>> +    }
>> +    printf("\n");
>
> As-is, this prints the following:
> OpenGL extensions:
> VERY_LONG_STRING
>
> Not only does it look funny, but it the newline may confuse scripts that
> need to parse wflinfo's output. To aid those scripts, I think this function
> should print this:
> OpenGL extensions: VERY_LONG_STRING

Whew. :) This is easier than the alternative of emulating glxinfo.
(break the line apart on whitespace, fitting as many extensions as
possible per line.)

I'll make your suggested changes and resubmit. Thanks for the feedback.

-Jordan


More information about the waffle mailing list