1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef HITRACE_COMMON_DEFINE_H 17 #define HITRACE_COMMON_DEFINE_H 18 19 #include <string> 20 21 #define EXPECTANTLY(exp) (__builtin_expect(!!(exp), true)) 22 #define UNEXPECTANTLY(exp) (__builtin_expect(!!(exp), false)) 23 #define UNUSED_PARAM __attribute__((__unused__)) 24 25 const std::string TRACE_TAG_ENABLE_FLAGS = "debug.hitrace.tags.enableflags"; 26 const std::string TRACE_KEY_APP_PID = "debug.hitrace.app_pid"; 27 28 const std::string DEBUGFS_TRACING_DIR = "/sys/kernel/debug/tracing/"; 29 const std::string TRACEFS_DIR = "/sys/kernel/tracing/"; 30 const std::string TRACING_ON_NODE = "tracing_on"; 31 const std::string TRACE_MARKER_NODE = "trace_marker"; 32 const std::string TRACE_NODE = "trace"; 33 34 const std::string TRACE_FILE_DEFAULT_DIR = "/data/log/hitrace/"; 35 const std::string TRACE_SAVED_EVENTS_FORMAT = "saved_events_format"; 36 37 38 #endif // HITRACE_COMMON_DEFINE_H