common_library: gettid is multiple declaration in cl_error
[staging/basesystem.git] / video_in_hal / systemservice / logger_service / server / include / ss_logger_common.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \brief    This file contains the callback for Notifications and Protocol
19 ///           commands.
20 ///
21 ///////////////////////////////////////////////////////////////////////////////
22
23 /** @addtogroup BaseSystem
24  *  @{
25  */
26 /** @addtogroup system_service
27  *  @ingroup BaseSystem
28  *  @{
29  */
30 /** @addtogroup logger_service
31  *  @ingroup system_service
32  *  @{
33  */
34
35 #ifndef LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_COMMON_H_
36 #define LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_COMMON_H_
37
38 #include <native_service/frameworkunified_types.h>
39 #include <native_service/frameworkunified_framework_types.h>
40
41 const CHAR DEBUG_LOG_PATH_DIR[] = "/tmp/frameworkunifiedlog";
42 const CHAR DEBUG_LOG_PATH_FN[] = "/tmp/frameworkunified_debug.log";
43 const CHAR TRANSMIT_LOG_PATH_FN[] = "/tmp/interfaceunified_transmit.log";
44 const CHAR PERFORMANCE_LOG_PATH_FN[] = "/tmp/frameworkunified_performance.log";
45 const CHAR DRINITIAL_LOG_PATH_FN[] = "/tmp/loggerservice_drinitial.log";
46 const CHAR DRLOCATION_LOG_PATH_FN[] = "/tmp/loggerservice_drlocation.log";
47 const CHAR KERNEL_LOG_PATH_FN[] = "/tmp/kernel.log";
48 const CHAR KERNEL_BOOT_LOG_PATH_FN[] = "/ramd/BS/ss/logger_service/rwdata/frameworkunifiedlog/kernelboot.log";
49
50 const UI_32 PERFORMANCELOG_FILE_SZ = 256 * 1024;
51
52 #define CLEAR_LOG_PATH_FN  "/nv/BS/ss/logger_service/rwdata/frameworkunifiedlog/"
53 #define NULLCHAR  '\0'
54
55 #define DEBUG_USB_PATH "/mnt/sda1"
56 #define KERNEL_LOG_PATH_DIR "kernellog"
57
58 template<typename C, EFrameworkunifiedStatus (C::*M)(HANDLE)>
59 class cpp_callback {
60  public:
61   static CallbackFunctionPtr set(void* pInst) {
62     if (pInst == NULL)
63       throw;
64     ms_pInst = pInst;
65     return &cpp_callback::call;
66   }
67   static EFrameworkunifiedStatus call(HANDLE y) {
68     if (ms_pInst == NULL)
69       return eFrameworkunifiedStatusFault;
70     C* c = static_cast<C*>(ms_pInst);
71     return (c->*M)(y);
72   }
73  private:
74   static void* ms_pInst;
75 };
76
77 template<typename C, EFrameworkunifiedStatus (C::*M)(HANDLE)>
78 void* cpp_callback<C, M>::ms_pInst = NULL;
79
80 typedef enum _LoggerServiceStatus {
81   eLSInit,
82   eLSStart,
83   eLSStop,
84 } ELOGGERSERVICESTATUS;
85
86 typedef enum {
87   SS_LOGGER_KLOG_GET, /* type : get kernel.log        */
88   SS_LOGGER_KBOOTLOG_CREATE /* type : create kernelboot.log */
89 } SS_LOGGER_KLOG_OPE_TYPE;
90
91 ////////////////////////////////////////////////////////////////////////////////////////////
92 /// \ingroup StopLoggingFunction
93 /// \~english @par Summary
94 ///       Stop the logging function.
95 /// \~english @param [in] hApp
96 ///       HANDLE    - Application handle
97 /// \~english @retval
98 ///       None
99 /// \~english @par Detail
100 ///       - The API stops the logging function.\n
101 ///       \n
102 ///       - Include    ss_logger_common.h
103 ///       - Library    libSS_SystemIfUnified.so
104 /// \~english @par Classification
105 ///       Public
106 /// \~english @see
107 ///       None
108 ////////////////////////////////////////////////////////////////////////////////////////////
109 void StopLoggingFunction(HANDLE hApp);
110
111 #endif  // LOGGER_SERVICE_SERVER_INCLUDE_SS_LOGGER_COMMON_H_
112
113 /** @}*/  // end of LoggerService
114 /** @}*/  // end of SystemService
115 /** @}*/  // end of BaseSystem