36 #ifndef __NV_PROFILER_H__
37 #define __NV_PROFILER_H__
76 struct timeval total_time;
105 void start(uint32_t sampling_interval_ms);
136 static void * ProfilerThread(
void *);
139 uint32_t sampling_interval;
142 pthread_mutex_t thread_lock;
144 pthread_t profiling_thread;
147 uint32_t num_cpu_cores;
149 bool check_cpu_usage;
154 struct ProfilerDataInternal
157 struct timeval start_time;
159 struct timeval stop_time;
163 struct timespec start_proc_cpu_clock_time;
165 struct timespec start_cpu_clock_time;
169 struct timespec stop_proc_cpu_clock_time;
171 struct timespec stop_cpu_clock_time;
181 uint64_t num_readings;
uint32_t cpu_freq_mhz
Operating frequency of the cpu in MHz.
void printProfilerData(std::ostream &outstream=std::cout)
Prints the profiler data to an output stream.
void start(uint32_t sampling_interval_ms)
Starts the profiler with the specified sampling interval.
void getProfilerData(NvAppProfilerData &data)
Gets the profiler data.
float avg_cpu_usage
Average CPU usage over the entire profiling duration.
Holds the profiling data.
static const uint64_t DefaultSamplingInterval
uint32_t num_cpu_cores
Number of cpu cores.
float peak_cpu_usage
Peak CPU usage during the profiling time.
static NvApplicationProfiler & getProfilerInstance()
Gets a reference to the global NvApplicationProfiler instance.
void stop()
Stops the profiler.