X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=trace_format.hpp;h=a8ee5eb8bab0347ce2a691691783d6c6939f6d22;hb=99f84fa0e278f4ca30577c22ede85c643c6017cc;hp=688c65a6ac8f03bac1a222ea266dd5d5f8a03308;hpb=19828970d2187334cae82f239f788b9f3a3912c6;p=apitrace diff --git a/trace_format.hpp b/trace_format.hpp index 688c65a..a8ee5eb 100644 --- a/trace_format.hpp +++ b/trace_format.hpp @@ -23,17 +23,60 @@ * **************************************************************************/ +/* + * Trace binary format. + * + * Grammar: + * + * trace = event* EOF + * + * event = EVENT_ENTER call_sig call_detail+ + * | EVENT_LEAVE call_no call_detail+ + * + * call_sig = sig_id ( name arg_names )? + * + * call_detail = ARG index value + * | RET value + * | END + * + * value = NULL + * | FALSE + * | TRUE + * | SINT int + * | UINT int + * | FLOAT float + * | DOUBLE double + * | STRING string + * | BLOB string + * | ENUM enum_sig + * | BITMASK bitmask_sig value + * | ARRAY length value+ + * | STRUCT struct_sig value+ + * | OPAQUE int + * + * call_sig = id name arg_name* + * | id + * + * enum_sig = id name value + * | id + * + * bitmask_sig = id count (name value)+ + * | id + * + * string = length (BYTE)* + * + */ + #ifndef _TRACE_FORMAT_HPP_ #define _TRACE_FORMAT_HPP_ namespace Trace { -#define TRACE_VERSION 0 +#define TRACE_VERSION 1 enum Event { EVENT_ENTER = 0, EVENT_LEAVE, - EVENT_MESSAGE }; enum CallDetail { @@ -60,35 +103,6 @@ enum Type { TYPE_OPAQUE, }; -/* - * trace = call* EOF - * - * call = name (detail)* END - * - * detail = ARG name value - * | RET value - * | ... - * - * value = VOID - * | BOOL BOOL_VALUE - * | SINT INT_VALUE - * | UINT INT_VALUE - * | FLOAT FLOAT_VALUE - * | STRING string - * | BLOB string - * | CONST name value - * | BITMASK value+ - * | ARRAY length - * - * bool = 0 | 1 - * - * name = string - * - * string = length (BYTE)* - * - * length = INT_VALUE - */ - } /* namespace Trace */