liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | #include <sys/types.h> |
| 3 | #include <sys/stat.h> |
| 4 | #include <sys/socket.h> |
| 5 | #include <netinet/in.h> |
| 6 | #include <netdb.h> |
| 7 | #include <arpa/inet.h> |
| 8 | #include <fcntl.h> |
| 9 | #include <time.h> |
| 10 | #include <unistd.h> |
| 11 | #include <errno.h> |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 12 | #include <string.h> |
| 13 | #include <stdlib.h> |
| 14 | #include <pthread.h> |
| 15 | |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 16 | #include "log_config.h" |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 17 | #include "mbtk_utils.h" |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 18 | |
| 19 | #define ALOG_DEV "/dev/log_radio" |
xf.li | 4364377 | 2024-03-04 19:39:53 -0800 | [diff] [blame] | 20 | #define LOG_CONFIG_LEN 50 |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 21 | |
l.yang | 67782e6 | 2024-11-05 01:28:10 -0800 | [diff] [blame] | 22 | #define RADIOLOG_BUFF_SIZE (4*1024) |
| 23 | #define MAX_BUFFER_SIZE (8*1024) |
| 24 | |
l.yang | 250444d | 2024-11-12 00:35:10 -0800 | [diff] [blame] | 25 | #define LOGGER_ENTRY_MAX_LEN (5*1024) |
| 26 | |
| 27 | |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 28 | typedef enum android_LogPriority { |
| 29 | ANDROID_LOG_UNKNOWN = 0, |
| 30 | ANDROID_LOG_DEFAULT, /* only for SetMinPriority() */ |
| 31 | ANDROID_LOG_VERBOSE, |
| 32 | ANDROID_LOG_DEBUG, |
| 33 | ANDROID_LOG_INFO, |
| 34 | ANDROID_LOG_WARN, |
| 35 | ANDROID_LOG_ERROR, |
| 36 | ANDROID_LOG_FATAL, |
| 37 | ANDROID_LOG_SILENT, /* only for SetMinPriority(); must be last */ |
| 38 | } android_LogPriority; |
| 39 | |
| 40 | typedef struct AndroidLogEntry_t { |
| 41 | time_t tv_sec; |
| 42 | long tv_nsec; |
| 43 | android_LogPriority priority; |
| 44 | int32_t pid; |
| 45 | int32_t tid; |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 46 | char * tag; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 47 | size_t messageLen; |
| 48 | const char * message; |
| 49 | } AndroidLogEntry; |
| 50 | |
xf.li | 4364377 | 2024-03-04 19:39:53 -0800 | [diff] [blame] | 51 | //static const char *log_file, *log_ip, *log_port, *log_prefix, *pid_file, *hostname; |
| 52 | static char log_file[LOG_CONFIG_LEN], log_ip[LOG_CONFIG_LEN], log_port[LOG_CONFIG_LEN], log_prefix[LOG_CONFIG_LEN], pid_file[LOG_CONFIG_LEN], hostname[LOG_CONFIG_LEN]; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 53 | static int log_size = 1 * 1024 * 1024; |
| 54 | |
| 55 | static log_config_entry *config = NULL; |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 56 | static char tmp_log[1024] = {0}; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 57 | |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 58 | static int fd_radio = 0; |
| 59 | |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 60 | int tcp_connect(char* ip, int port); |
l.yang | 67782e6 | 2024-11-05 01:28:10 -0800 | [diff] [blame] | 61 | |
l.yang | 250444d | 2024-11-12 00:35:10 -0800 | [diff] [blame] | 62 | extern int tmp_rd_fd; |
l.yang | fa05af3 | 2024-11-27 00:00:56 -0800 | [diff] [blame] | 63 | //extern char radiolog_buff[MAX_BUFFER_SIZE]; |
| 64 | extern char *radio_globalPtr; |
| 65 | extern int radio_len; |
l.yang | d2c71bc | 2024-12-16 19:24:24 -0800 | [diff] [blame] | 66 | extern int emmc_pro; |
l.yang | fa05af3 | 2024-11-27 00:00:56 -0800 | [diff] [blame] | 67 | |
l.yang | 250444d | 2024-11-12 00:35:10 -0800 | [diff] [blame] | 68 | |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 69 | void hex_print(char* buf, int len) |
| 70 | { |
| 71 | int i; |
| 72 | |
| 73 | for (i = 0; i < len; i++) { |
| 74 | printf("%x ", buf[i]); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | static char filterPriToChar(android_LogPriority pri) |
| 79 | { |
| 80 | switch (pri) { |
| 81 | case ANDROID_LOG_VERBOSE: |
| 82 | return 'V'; |
| 83 | case ANDROID_LOG_DEBUG: |
| 84 | return 'D'; |
| 85 | case ANDROID_LOG_INFO: |
| 86 | return 'I'; |
| 87 | case ANDROID_LOG_WARN: |
| 88 | return 'W'; |
| 89 | case ANDROID_LOG_ERROR: |
| 90 | return 'E'; |
| 91 | case ANDROID_LOG_FATAL: |
| 92 | return 'F'; |
| 93 | case ANDROID_LOG_SILENT: |
| 94 | return 'S'; |
| 95 | |
| 96 | case ANDROID_LOG_DEFAULT: |
| 97 | case ANDROID_LOG_UNKNOWN: |
| 98 | default: |
| 99 | return '?'; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | static android_LogPriority filterCharToPri(char c) |
| 104 | { |
| 105 | switch (c) { |
| 106 | case 'v': |
| 107 | return ANDROID_LOG_VERBOSE; |
| 108 | case 'd': |
| 109 | return ANDROID_LOG_DEBUG; |
| 110 | case 'i': |
| 111 | return ANDROID_LOG_INFO; |
| 112 | case 'w': |
| 113 | return ANDROID_LOG_WARN; |
| 114 | case 'e': |
| 115 | return ANDROID_LOG_ERROR; |
| 116 | case 'f': |
| 117 | return ANDROID_LOG_FATAL; |
| 118 | case 's': |
| 119 | return ANDROID_LOG_SILENT; |
| 120 | case '*': |
| 121 | default: |
| 122 | return ANDROID_LOG_VERBOSE; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | int fileter_log(int pri, char *tag, struct filter_list_t *filter) |
| 127 | { |
| 128 | struct filter_list_t *_filter = filter; |
| 129 | |
| 130 | while(_filter) |
| 131 | { |
| 132 | int p = filterCharToPri(_filter->priority); |
| 133 | if(_filter->tag) |
| 134 | { |
| 135 | int len = strlen(_filter->tag); |
| 136 | // tag and priority |
| 137 | if(0 == memcmp(_filter->tag, tag, len) && ((pri > p) || (pri == p))) |
| 138 | return 0; |
| 139 | }else{ // have no tag |
| 140 | if(pri < p) |
| 141 | return -1; |
| 142 | else |
| 143 | return 0; |
| 144 | } |
| 145 | _filter = _filter->next; |
| 146 | } |
| 147 | |
| 148 | return -1; |
| 149 | } |
| 150 | |
| 151 | int alog_process(char* data, int len, AndroidLogEntry *entry) |
| 152 | { |
| 153 | int i, n = 0; |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 154 | // int tmp_len; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 155 | |
| 156 | for (i = 0; i < len;) { |
| 157 | if (data[i] == '\0') { |
| 158 | i += 1; |
| 159 | } else { |
| 160 | switch (n) { |
| 161 | case 0: { |
| 162 | // printf("%d - %d: %x\n", i, tmp_len, data[i]); |
| 163 | i++; |
| 164 | break; |
| 165 | } |
| 166 | case 1: { |
| 167 | int* pid = (int*)&data[i]; |
| 168 | entry->pid = *pid; |
| 169 | // printf("%d pid: %d\n", i, entry->pid); |
| 170 | i += 4; |
| 171 | break; |
| 172 | } |
| 173 | case 2: { |
| 174 | int* tid = (int*)&data[i]; |
| 175 | entry->tid = *tid; |
| 176 | // printf("%d tid: %d\n", i, entry->tid); |
| 177 | i += 4; |
| 178 | break; |
| 179 | } |
| 180 | case 3: { |
| 181 | // printf("%d - %d: %x %x %x %x\n", i, tmp_len, data[i], data[i + 1], data[i + 2], data[i + 3]); |
| 182 | time_t* _t = (time_t*)&data[i]; |
| 183 | entry->tv_sec = *_t; |
| 184 | i += 8; |
| 185 | break; |
| 186 | } |
| 187 | case 4: { |
| 188 | entry->priority = data[i]; |
| 189 | entry->tag = &data[i + 1]; |
| 190 | i += strlen(&data[i]); |
| 191 | break; |
| 192 | } |
| 193 | //* format: <priority:1><tag:N>\0<message:N>\0 |
| 194 | case 5: { |
| 195 | entry->message = &data[i]; |
| 196 | entry->messageLen = strlen(&data[i]); |
| 197 | i += entry->messageLen; |
| 198 | break; |
| 199 | } |
| 200 | default: |
| 201 | printf("process error \n"); |
l.yang | f08c4a0 | 2024-11-24 21:18:22 -0800 | [diff] [blame] | 202 | return -1; |
| 203 | //break; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 204 | } |
| 205 | n++; |
| 206 | } |
| 207 | } |
| 208 | return 0; |
| 209 | } |
| 210 | |
| 211 | int android_log_printLogLine( |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 212 | struct file_list_t *_file_list, |
| 213 | const AndroidLogEntry *entry) |
| 214 | { |
| 215 | char priChar; |
| 216 | char timeBuf[32]; |
l.yang | 250444d | 2024-11-12 00:35:10 -0800 | [diff] [blame] | 217 | char defaultBuffer[LOGGER_ENTRY_MAX_LEN] = {0}; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 218 | size_t totalLen; |
xf.li | 01e3982 | 2024-10-30 16:00:32 +0800 | [diff] [blame] | 219 | int index = 0; |
| 220 | int len = 0; |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 221 | struct stat s; |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 222 | |
l.yang | 67782e6 | 2024-11-05 01:28:10 -0800 | [diff] [blame] | 223 | |
| 224 | static char buffer[MAX_BUFFER_SIZE] = {0}; |
| 225 | static int buffer_index = 0; |
l.yang | fa05af3 | 2024-11-27 00:00:56 -0800 | [diff] [blame] | 226 | radio_globalPtr = buffer; |
l.yang | 7ec8098 | 2024-12-15 23:34:35 -0800 | [diff] [blame] | 227 | |
| 228 | if(access("/etc/syslog_close", F_OK) == 0) |
| 229 | { |
| 230 | return 0; |
| 231 | } |
| 232 | |
l.yang | 250444d | 2024-11-12 00:35:10 -0800 | [diff] [blame] | 233 | if(fcntl(fd_radio, F_GETFL) == -1 || access(tmp_log, W_OK) != 0) |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 234 | { |
| 235 | fd_radio = open(tmp_log, O_CREAT | O_WRONLY| O_APPEND, 0600); |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 236 | if (fd_radio < 0) |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 237 | { |
| 238 | fprintf(stderr, "failed to open %s: %s\n", tmp_log, strerror(errno)); |
| 239 | exit(-1); |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 240 | } |
l.yang | 250444d | 2024-11-12 00:35:10 -0800 | [diff] [blame] | 241 | tmp_rd_fd = fd_radio; |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 242 | } |
l.yang | 67782e6 | 2024-11-05 01:28:10 -0800 | [diff] [blame] | 243 | |
| 244 | |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 245 | if (log_size && (!stat(tmp_log, &s)) && (s.st_size > log_size)) |
| 246 | { |
| 247 | fd_radio = get_rotate_file(fd_radio, log_file, _file_list); |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 248 | if (fd_radio < 0) |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 249 | { |
| 250 | fprintf(stderr, "failed to open %s: %s\n", log_file, strerror(errno)); |
| 251 | exit(-1); |
| 252 | } |
l.yang | 250444d | 2024-11-12 00:35:10 -0800 | [diff] [blame] | 253 | tmp_rd_fd = fd_radio; |
| 254 | |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 255 | } |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 256 | |
| 257 | if(fileter_log(entry->priority, entry->tag, config->filter_list)) |
| 258 | { |
| 259 | // printf("%s %d: fileter pri:%d tag:%s!\n", __FUNCTION__, __LINE__, entry->priority, entry->tag); |
| 260 | return -1; |
| 261 | } |
| 262 | |
| 263 | priChar = filterPriToChar(entry->priority); |
| 264 | struct tm* ptm = localtime(&entry->tv_sec); |
| 265 | strftime(timeBuf, sizeof(timeBuf), "%Y-%m-%d %H:%M:%S", ptm); |
| 266 | |
| 267 | totalLen = snprintf(defaultBuffer, sizeof(defaultBuffer), |
| 268 | "%s %c/%s (%d): %s\n", timeBuf, priChar, entry->tag, entry->pid, entry->message); |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 269 | |
xf.li | 01e3982 | 2024-10-30 16:00:32 +0800 | [diff] [blame] | 270 | len = strlen(defaultBuffer); |
| 271 | if(access("/etc/syslog_encrypt_flag", F_OK) == 0) |
| 272 | { |
| 273 | for(index = 0; index < len; index++) |
| 274 | { |
| 275 | defaultBuffer[index] ^= 1; |
| 276 | } |
| 277 | } |
l.yang | d2c71bc | 2024-12-16 19:24:24 -0800 | [diff] [blame] | 278 | if(emmc_pro) |
l.yang | 67782e6 | 2024-11-05 01:28:10 -0800 | [diff] [blame] | 279 | { |
l.yang | d2c71bc | 2024-12-16 19:24:24 -0800 | [diff] [blame] | 280 | if(buffer_index + totalLen >= RADIOLOG_BUFF_SIZE && buffer_index < RADIOLOG_BUFF_SIZE) |
| 281 | { |
| 282 | memcpy(buffer + buffer_index, defaultBuffer, totalLen); |
| 283 | buffer_index += totalLen; |
| 284 | if (write(fd_radio, buffer, buffer_index) < 0) |
| 285 | { |
| 286 | perror("write error"); |
| 287 | close(fd_radio); |
| 288 | return -1; |
| 289 | } |
| 290 | buffer_index = 0; // Reset buffer index after flushing |
| 291 | } |
| 292 | else |
| 293 | { |
| 294 | memcpy(buffer + buffer_index, defaultBuffer, totalLen); |
| 295 | buffer_index += totalLen; |
| 296 | //memcpy(radiolog_buff,buffer,buffer_index); |
| 297 | } |
| 298 | } |
| 299 | else |
| 300 | { |
| 301 | if (write(fd_radio, defaultBuffer, totalLen) < 0) |
l.yang | 67782e6 | 2024-11-05 01:28:10 -0800 | [diff] [blame] | 302 | { |
| 303 | perror("write error"); |
l.yang | 250444d | 2024-11-12 00:35:10 -0800 | [diff] [blame] | 304 | close(fd_radio); |
l.yang | 67782e6 | 2024-11-05 01:28:10 -0800 | [diff] [blame] | 305 | return -1; |
| 306 | } |
l.yang | 67782e6 | 2024-11-05 01:28:10 -0800 | [diff] [blame] | 307 | } |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 308 | |
| 309 | |
l.yang | 67782e6 | 2024-11-05 01:28:10 -0800 | [diff] [blame] | 310 | return 0; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | void* alog_thread(void* argv) |
| 314 | { |
| 315 | int dev_fd, ret; |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 316 | // int log_fd; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 317 | AndroidLogEntry entry; |
l.yang | 250444d | 2024-11-12 00:35:10 -0800 | [diff] [blame] | 318 | char buf[LOGGER_ENTRY_MAX_LEN] = {0}; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 319 | static struct file_list_t file_list; |
| 320 | config = (log_config_entry *)argv; |
| 321 | |
| 322 | pthread_detach(pthread_self()); |
| 323 | if (NULL == argv) |
| 324 | return NULL; |
| 325 | |
| 326 | dev_fd = open(ALOG_DEV, O_RDONLY, 0600); |
| 327 | if (dev_fd < 0) { |
| 328 | fprintf(stderr, "failed to open %s: %s\n", ALOG_DEV, strerror(errno)); |
| 329 | exit(-1); |
| 330 | } |
| 331 | |
| 332 | memset(&file_list, 0, sizeof(struct file_list_t)); |
| 333 | file_list.total = config->rotate_file_count; |
xf.li | 4364377 | 2024-03-04 19:39:53 -0800 | [diff] [blame] | 334 | //log_file = config->out_path; |
| 335 | memset(log_file, 0, sizeof(log_file)); |
| 336 | memset(log_ip, 0, sizeof(log_ip)); |
| 337 | memset(log_port, 0, sizeof(log_port)); |
| 338 | memset(log_prefix, 0, sizeof(log_prefix)); |
| 339 | memset(pid_file, 0, sizeof(pid_file)); |
| 340 | memset(hostname, 0, sizeof(hostname)); |
| 341 | if(config->out_path != NULL) |
| 342 | { |
| 343 | strncpy(log_file, config->out_path, LOG_CONFIG_LEN - 1); |
| 344 | } |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 345 | |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 346 | if (config->ip && config->port) |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 347 | { |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 348 | int port = atoi(config->port); |
| 349 | printf("%s %d : %s:%s\n", __FUNCTION__, __LINE__, config->ip, config->port); |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 350 | tcp_connect(config->ip, port); |
| 351 | } |
| 352 | else if (strlen(log_file) > 0) |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 353 | { |
| 354 | //sprintf(tmp_log, "/tmp/log%s", strstr_tail(log_file, "/")); |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 355 | |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 356 | snprintf(tmp_log,sizeof(tmp_log), "%s", log_file); |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 357 | // 先将文件保存到 /tmp/log/ 目录下,后面到达 rotate_file_size 后,转移到out_path |
l.yang | 250444d | 2024-11-12 00:35:10 -0800 | [diff] [blame] | 358 | |
| 359 | fd_radio = open(tmp_log, O_CREAT | O_WRONLY| O_APPEND, 0600); |
| 360 | if (fd_radio < 0) |
| 361 | { |
| 362 | fprintf(stderr, "failed to open %s: %s\n", tmp_log, strerror(errno)); |
| 363 | exit(-1); |
| 364 | } |
| 365 | tmp_rd_fd = fd_radio; |
| 366 | } |
| 367 | else |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 368 | { |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 369 | //log_fd = STDOUT_FILENO; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 370 | } |
| 371 | if(config->rotate_file_size) |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 372 | { |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 373 | log_size = config->rotate_file_size; |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 374 | } |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 375 | printf("android log start...\n"); |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 376 | while (1) |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 377 | { |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 378 | ret = read(dev_fd, buf, sizeof(buf)); |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 379 | if (ret < 0) |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 380 | { |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 381 | printf("read error\n"); |
hj.shao | ccb8e21 | 2025-07-07 00:37:37 -0700 | [diff] [blame] | 382 | continue; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 383 | } |
| 384 | alog_process(buf, ret, &entry); |
l.yang | b7972c7 | 2024-10-15 22:34:51 -0700 | [diff] [blame] | 385 | android_log_printLogLine(&file_list, &entry); |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 386 | memset(buf, 0, sizeof(buf)); |
| 387 | } |
| 388 | close(dev_fd); |
b.liu | 9e8584b | 2024-11-06 19:21:28 +0800 | [diff] [blame] | 389 | |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 390 | printf("%s exit \n", __FUNCTION__); |
| 391 | pthread_exit(NULL); |
| 392 | return NULL; |
| 393 | } |