1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
7 * This file defines the <code>PPB_Trace_Event</code> interface. It is meant
8 * to be used in plugins as the API that trace macros from trace_event.h use.
17 * A trace event timestamp.
19 typedef int64_t PP_TraceEventTime
;
21 interface PPB_Trace_Event_Dev
{
23 * Gets a pointer to a character for identifying a category name in the
24 * tracing system as well as for being able to early exit in client-side
27 * NB: This mem_t return value should technically be const, but return values
28 * for Pepper IDL of mem_t type are not const. The same is true for the arg
29 * |category_enabled| for AddTraceEvent.
31 mem_t GetCategoryEnabled
([in] cstr_t category_name
);
34 * Adds a trace event to the platform tracing system. This function call is
35 * usually the result of a TRACE_* macro from trace_event.h when tracing and
36 * the category of the particular trace are enabled. It is not advisable to
37 * call this function on its own; it is really only meant to be used by the
42 [in] mem_t category_enabled
,
45 [in] uint32_t num_args
,
46 [in, size_as
=num_args
] str_t
[] arg_names
,
47 [in, size_as
=num_args
] uint8_t
[] arg_types
,
48 [in, size_as
=num_args
] uint64_t
[] arg_values
,
52 * Version of the above interface that allows specifying a custom thread id
53 * and timestamp. This is useful for when tracing data cannot be registered
54 * in real time. For example, this could be used by storing timestamps
55 * internally and then registering the events retroactively.
58 void AddTraceEventWithThreadIdAndTimestamp
(
60 [in] mem_t category_enabled
,
63 [in] int32_t thread_id
,
64 [in] PP_TraceEventTime timestamp
,
65 [in] uint32_t num_args
,
66 [in, size_as
=num_args
] str_t
[] arg_names
,
67 [in, size_as
=num_args
] uint8_t
[] arg_types
,
68 [in, size_as
=num_args
] uint64_t
[] arg_values
,
72 * Get the current clock value. Since this uses the same function as the trace
73 * events use internally, it can be used to create events with explicit time
77 PP_TraceEventTime Now
();
80 * Sets the thread name of the calling thread in the tracing system so it will
81 * show up properly in chrome://tracing.
83 void SetThreadName
([in] cstr_t thread_name
);