cubeb_tracing.h (1053B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef CUBEB_TRACING_H 8 #define CUBEB_TRACING_H 9 10 #include <MicroGeckoProfiler.h> 11 12 #define CUBEB_REGISTER_THREAD(name) \ 13 do { \ 14 char stacktop; \ 15 uprofiler_register_thread(name, &stacktop); \ 16 } while (0) 17 18 #define CUBEB_UNREGISTER_THREAD() uprofiler_unregister_thread() 19 20 // Insert a tracing marker, with a particular name. 21 // Phase can be 'x': instant marker, start time but no duration 22 // 'b': beginning of a marker with a duration 23 // 'e': end of a marker with a duration 24 #define CUBEB_TRACE(name, phase) \ 25 uprofiler_simple_event_marker(name, phase, 0, NULL, NULL, NULL) 26 27 #endif // CUBEB_TRACING_H