diff options
author | joon.c.baek <joon.c.baek@samsung.com> | 2015-05-22 13:51:10 +0900 |
---|---|---|
committer | joon.c.baek <joon.c.baek@samsung.com> | 2015-05-22 14:02:04 +0900 |
commit | 570eeb2c5181776c56e6a070a087c3bab1b45f92 (patch) | |
tree | 71cfb31a16e7797f1e34447251323cea14330c0f /include | |
parent | 28373dcbed525c8c3a87a6806601572e1d19f2c8 (diff) | |
download | ttrace-570eeb2c5181776c56e6a070a087c3bab1b45f92.tar.gz ttrace-570eeb2c5181776c56e6a070a087c3bab1b45f92.tar.bz2 ttrace-570eeb2c5181776c56e6a070a087c3bab1b45f92.zip |
ttrace: Migration ttrace from Tizen 2.4 repository
Migration ttrace from Tizen 2.4 repository
Change-Id: Ib70d79e7535a74a3681e5fc63eeaba27503923f8
Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/TTraceWrapper.h | 36 | ||||
-rw-r--r-- | include/trace.h | 118 | ||||
-rw-r--r-- | include/ttrace.h | 56 |
3 files changed, 210 insertions, 0 deletions
diff --git a/include/TTraceWrapper.h b/include/TTraceWrapper.h new file mode 100644 index 0000000..43ece64 --- /dev/null +++ b/include/TTraceWrapper.h @@ -0,0 +1,36 @@ +/* + * T-trace + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __TTRACE_WRAPPER_H_ +#define __TTRACE_WRAPPER_H_ + +#define MAX_LEN 512 + +#include <ttrace.h> +#include <stdarg.h> +class TTraceWrapper { + private: + int tag; + public: + TTraceWrapper(int tags, const char* label, ...); + ~TTraceWrapper(); +}; + +#define TTRACE(tags, label, args...) TTraceWrapper ttrace(tags, label, ##args) + +#endif + diff --git a/include/trace.h b/include/trace.h new file mode 100644 index 0000000..3677114 --- /dev/null +++ b/include/trace.h @@ -0,0 +1,118 @@ +/* + * T-trace + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file trace.h + * @brief This file contains the tracing API. + */ + +#ifndef _CDBG_TIZEN_TRACE_H_ +#define _CDBG_TIZEN_TRACE_H_ + +#include <tizen.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @addtogroup CAPI_SYSTEM_TRACE_MODULE + * @{ + * + */ + +/** +* @brief Enumeration for Trace Error. +* @since_tizen 2.4 +*/ +typedef enum { + TRACE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ + TRACE_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR /**< I/O error */ +} trace_error_e; + +/** + * @brief Writes a trace event to indicate that a synchronous event has begun. + * + * @since_tizen 2.4 + * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section. + * @param[in] name The name of event (optionally containing format specifiers) + * @exception TRACE_ERROR_NONE Success + * @exception TRACE_ERROR_IO_ERROR I/O error + * @see trace_end() + */ +void trace_begin(const char *name, ...); + +/** + * @brief Writes a trace event to indicate that the synchronous event has ended. + * + * @since_tizen 2.4 + * @remarks trace_end() ends the most recently called trace_begin(). + * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section. + * @exception TRACE_ERROR_NONE Success + * @exception TRACE_ERROR_IO_ERROR I/O error + * @see trace_begin() + */ +void trace_end(); + +/** + * @brief Writes a trace event to indicate that an asynchronous event has begun. + * + * @since_tizen 2.4 + * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section. + * @param[in] cookie An unique identifier for distinguishing simultaneous events + * @param[in] name The name of event (optionally containing format specifiers) + * @exception TRACE_ERROR_NONE Success + * @exception TRACE_ERROR_IO_ERROR I/O error + * @see trace_async_end() + */ +void trace_async_begin(int cookie, const char *name, ...); + +/** + * @brief Writes a trace event to indicate that the asynchronous event has ended. + * + * @since_tizen 2.4 + * @remarks trace_async_end() ends matched trace_async_begin() which has same cookie and name. + * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section. + * @param[in] cookie An unique identifier for distinguishing simultaneous events + * @param[in] name The name of event (optionally containing format specifiers) + * @exception TRACE_ERROR_NONE Success + * @exception TRACE_ERROR_IO_ERROR I/O error + * @see trace_async_begin() + */ +void trace_async_end(int cookie, const char *name, ...); + +/** + * @brief Writes a trace event to track change of integer counter + * + * @since_tizen 2.4 + * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section. + * @param[in] value The counter value + * @param[in] name The name of event (optionally containing format specifiers) + * @exception TRACE_ERROR_NONE Success + * @exception TRACE_ERROR_IO_ERROR I/O error + */ +void trace_update_counter(int value, const char *name, ...); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* _CDBG_TIZEN_TRACE_H_ */ + diff --git a/include/ttrace.h b/include/ttrace.h new file mode 100644 index 0000000..809d124 --- /dev/null +++ b/include/ttrace.h @@ -0,0 +1,56 @@ +/* + * T-trace + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _CDBG_TIZEN_TTRACE_H_ +#define _CDBG_TIZEN_TTRACE_H_ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Define TTRACE_TAG */ +#define TTRACE_TAG_NEVER 0 // This tag is never enabled. +#define TTRACE_TAG_ALWAYS (1<<0) // This tag is always enabled. +#define TTRACE_TAG_APP TTRACE_TAG_ALWAYS +#define TTRACE_TAG_GRAPHICS (1<<1) +#define TTRACE_TAG_INPUT (1<<2) +#define TTRACE_TAG_VIEW (1<<3) +#define TTRACE_TAG_WEB (1<<4) +#define TTRACE_TAG_WINDOW_MANAGER (1<<5) +#define TTRACE_TAG_APPLICATION_MANAGER (1<<6) +#define TTRACE_TAG_IMAGE (1<<7) +#define TTRACE_TAG_AUDIO (1<<8) +#define TTRACE_TAG_VIDEO (1<<9) +#define TTRACE_TAG_CAMERA (1<<10) +#define TTRACE_TAG_HAL (1<<11) +#define TTRACE_TAG_MEDIA_CONTENT (1<<12) +#define TTRACE_TAG_MEDIA_DB (1<<13) +#define TTRACE_TAG_SCREEN_MIRRORING (1<<14) +#define TTRACE_TAG_LAST TTRACE_TAG_SCREEN_MIRRORING + +void traceBegin(int tag, const char *name, ...); +void traceEnd(int tag); +void traceAsyncBegin(int tag, int cookie, const char *name, ...); +void traceAsyncEnd(int tag, int cookie, const char *name, ...); +void traceMark(int tag, const char *name, ...); +void traceCounter(int tag, int value, const char *name, ...); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _CDBG_TIZEN_TTRACE_H_ */ + |