[Webkit-unassigned] [Bug 70761] [chromium] Add category and TraceValue support to TraceEvent

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 24 15:15:24 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=70761





--- Comment #2 from John Bates <jbates at google.com>  2011-10-24 15:15:24 PST ---
I discussed this with jbauman a bit, and we had some initial design ideas based on the constraint that the API must go through a vtable to get to chromium code. I'm sure more issues will come up so feel free to comment if you see any issues.

Design goals:
- fast (no vtable to check if a category is enabled).
- support 0, 1 or 2 custom parameters
- support begin, end, and instant event types.
- limit code duplication (especially avoid struct layout duplication).

namespace WebKit?
{

struct TraceCategoryInfo
{
  const bool* isEnabled;
  const void* platformArgument;
};

enum TraceEventType
{
  TRACE_EVENT_BEGIN,
  TRACE_EVENT_END,
  TRACE_EVENT_INSTANT
};

class TraceValue
{
... yep, duplicate most/all of this class ...
};

class PlatformTraceProvider
{
virtual TraceCategoryInfo getCategoryEnabledBool(const char* long_lived_string);

virtual void addTraceEvent(TraceEventType type, const void* platformArgument, const char* name, const char* arg1name, TraceValue arg1val, ..., bool copy_strings);
};

Then the macro would look something like:
static TraceCategoryInfo category = PlatformTraceProvider::GetInstance()->getCategoryInfo(category_name);
if (*category.isEnabled)
  PlatformTraceProvider::GetInstance()->addTraceEvent(..., category.platformArgument, ...);

The implementation would have to convert between WebKit types (TraceEventType and TraceValue) and equivalent chromium types. The platformArgument would be set to point to the native chromium CategoryInfo struct, but WebKit code would not need to know what that type is.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list