NVIDIA IndeX API nvidia_logo_transpbg.gif Up
ievent_tracing.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 *****************************************************************************/
26
27#ifndef NVIDIA_INDEX_ITRACE_EVENTS_H
28#define NVIDIA_INDEX_ITRACE_EVENTS_H
29
30#include <mi/base/interface_declare.h>
31#include <mi/dice.h>
32#include <mi/base/types.h>
33
34namespace nv {
35namespace index {
36
40{
41 NONE = 0x00,
42 VALUE_U64 = 0x01,
43 VALUE_S64 = 0x02,
44 VALUE_F64 = 0x03,
46 NEW_NS = 0x06,
47 CLEAR_NS = 0x07
48};
49
53 : public mi::base::Interface_declare<0x55d30b9a,0x4927,0x4150,0x90,0x63,0xd6,0xd6,0x8a,0x40,0xbf,0xf0>
54{
55public:
56
58 virtual void next() = 0;
59
61 virtual bool begin() = 0;
62
64 virtual bool end() = 0;
65
67 virtual const char* get_namespace() const = 0;
68
70 virtual mi::Sint32 get_namespace_id() const = 0;
71
73 virtual const char* get_name() const = 0;
74
76 virtual mi::Uint64 get_timestamp() const = 0;
77
79 virtual mi::Uint32 get_host_id() const = 0;
80
82 virtual ITrace_event_type get_type() const = 0;
83
85 virtual void get_value(mi::Uint64& value) const = 0;
86
88 virtual void get_value(mi::Sint64& value) const = 0;
89
91 virtual void get_value(mi::Float64& value) const = 0;
92};
93
95
98 : public mi::base::Interface_declare<0xe05ed2f7,0x71da,0x4211,0x87,0x1b,0x46,0xfd,0x3f,0xb8,0x8a,0xbd>
99{
100public:
101
103 virtual mi::Size get_collection_id() const = 0;
104
106 virtual mi::Uint64 get_collection_timestamp() const = 0;
107
109 virtual mi::Uint32 get_local_host_id() const = 0;
110
112 virtual mi::Size get_nb_traces() const = 0;
113
116};
117
121 : public mi::base::Interface_declare<0xb9b64b1b,0x8349,0x4099,0xbe,0x2b,0x86,0x5f,0xca,0x04,0xe0,0x92>
122{
123public:
125 virtual void handle(ITrace_collection* collection) = 0;
126};
127
131 : public mi::base::Interface_declare<0x5c604cf0,0xb4ac,0x4c19,0xb8,0xf8,0x2d,0x1c,0xeb,0xa6,0x9c,0xff>
132{
133public:
134
139
144
151 virtual ITrace_collection* get_collection(mi::Uint32 collection_id, bool raw = false) = 0;
152
162 virtual void record(const char* ns, mi::Sint32 ns_id, const char* name, mi::Uint64 value) = 0;
163
173 virtual void record(const char* ns, mi::Sint32 ns_id, const char* name, mi::Sint64 value) = 0;
174
184 virtual void record(const char* ns, mi::Sint32 ns_id, const char* name, mi::Float64 value) = 0;
185
195 virtual void record_time_duration(const char* ns,
196 mi::Sint32 ns_id,
197 const char* name,
198 mi::Uint64 start_timestamp,
199 mi::Uint64 duration) = 0;
200
210 virtual void record_time_interval(const char* ns,
211 mi::Sint32 ns_id,
212 const char* name,
213 mi::Uint64 start_timestamp,
214 mi::Uint64 end_timestamp) = 0;
215};
216
217} // namespace index
218} // namespace nv
219
220#endif // NVIDIA_INDEX_ITRACE_EVENTS_H
Main class that handles trace event collection and recording.
Definition: ievent_tracing.h:132
virtual void record_time_duration(const char *ns, mi::Sint32 ns_id, const char *name, mi::Uint64 start_timestamp, mi::Uint64 duration)=0
Record a time duration trace of format <namespace, namespace_id, trace_name, start_timestamp,...
virtual void remove_collection_handler(ITrace_collection_handler *handler)=0
Removes a notification handler for the availability of trace collection.
virtual void record(const char *ns, mi::Sint32 ns_id, const char *name, mi::Float64 value)=0
Record a trace tuple of format <namespace, namespace_id, trace_name, trace_value> for Float64.
virtual ITrace_collection * get_collection(mi::Uint32 collection_id, bool raw=false)=0
Get a specific collection id.
virtual void record(const char *ns, mi::Sint32 ns_id, const char *name, mi::Sint64 value)=0
Record a trace tuple of format <namespace, namespace_id, trace_name, trace_value> for Sint64.
virtual void record_time_interval(const char *ns, mi::Sint32 ns_id, const char *name, mi::Uint64 start_timestamp, mi::Uint64 end_timestamp)=0
Record a time interval trace of format <namespace, namespace_id, trace_name, start_timestamp,...
virtual void record(const char *ns, mi::Sint32 ns_id, const char *name, mi::Uint64 value)=0
Record a trace tuple of format <namespace, namespace_id, trace_name, trace_value> for Uint64.
virtual void add_collection_handler(ITrace_collection_handler *handler)=0
Add a notification handler for the availability of trace collection.
Callback interface for handling a trace collection.
Definition: ievent_tracing.h:122
virtual void handle(ITrace_collection *collection)=0
Handle a trace collection.
Definition: ievent_tracing.h:99
virtual mi::Uint64 get_collection_timestamp() const =0
Time when collection happened.
virtual ITrace_event_iterator * get_trace_iterator() const =0
Get iterator for accessing individual trace events.
virtual mi::Size get_nb_traces() const =0
Number of trace events in this collection.
virtual mi::Uint32 get_local_host_id() const =0
Host id where collection happened.
virtual mi::Size get_collection_id() const =0
Collection id.
Iterator for accessing individual trace events.
Definition: ievent_tracing.h:54
virtual const char * get_namespace() const =0
Namespace name for this trace event.
virtual mi::Uint64 get_timestamp() const =0
Timestamp of event recording.
virtual bool end()=0
Has the iterator reached the end of the trace collection?
virtual void next()=0
Move iterator to next event.
virtual ITrace_event_type get_type() const =0
Type of event.
virtual const char * get_name() const =0
Name for trace event.
virtual void get_value(mi::Float64 &value) const =0
Get event value as Float64.
virtual mi::Sint32 get_namespace_id() const =0
Namespace id for this trace event.
virtual mi::Uint32 get_host_id() const =0
Host id for where this event was collected.
virtual void get_value(mi::Sint64 &value) const =0
Get event value as Sint64.
virtual bool begin()=0
Is the iterator pointing to the beginning?
virtual void get_value(mi::Uint64 &value) const =0
Get event value as Uint64.
ITrace_event_type
Value types for trace events.
Definition: ievent_tracing.h:40
@ VALUE_DURATION
Time duration value.
Definition: ievent_tracing.h:45
@ VALUE_S64
Sint64 value.
Definition: ievent_tracing.h:43
@ VALUE_U64
Uint64 value.
Definition: ievent_tracing.h:42
@ VALUE_F64
Float64 value.
Definition: ievent_tracing.h:44
@ NEW_NS
Namespace scope start.
Definition: ievent_tracing.h:46
@ CLEAR_NS
Namespace scope end.
Definition: ievent_tracing.h:47
Common namespace for all NVIDIA APIs.
Definition: iindex.h:349