2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/trace/tizen/trace-manager-impl-tizen.h>
22 #include <dali/integration-api/debug.h>
26 #include <dali/devel-api/adaptor-framework/environment-variable.h>
36 const char* DALI_TRACE_ENABLE_PRINT_LOG_ENV = "DALI_TRACE_ENABLE_PRINT_LOG";
37 const char* EMPTY_TAG = "(null)";
38 static bool gTraceManagerEnablePrintLog = false;
42 TraceManagerTizen::TraceManagerTizen(PerformanceInterface* performanceInterface)
43 : TraceManager(performanceInterface)
45 const char* enablePrintLog = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_TRACE_ENABLE_PRINT_LOG_ENV);
46 if(enablePrintLog && std::atoi(enablePrintLog) != 0)
48 gTraceManagerEnablePrintLog = true;
52 Dali::Integration::Trace::LogContextFunction TraceManagerTizen::GetLogContextFunction()
57 void TraceManagerTizen::LogContext(bool start, const char* tag)
61 traceBegin(TTRACE_TAG_GRAPHICS, tag ? tag : EMPTY_TAG);
63 if(gTraceManagerEnablePrintLog)
65 DALI_LOG_DEBUG_INFO("BEGIN: %s\n", tag ? tag : EMPTY_TAG);
70 traceEnd(TTRACE_TAG_GRAPHICS);
72 if(gTraceManagerEnablePrintLog)
74 DALI_LOG_DEBUG_INFO("END: %s\n", tag ? tag : EMPTY_TAG);
79 } // namespace Adaptor
81 } // namespace Internal