Greg Kroah-Hartman | 355b050 | 2011-11-30 20:18:14 +0900 | [diff] [blame] | 1 | /* include/linux/logger.h |
| 2 | * |
| 3 | * Copyright (C) 2007-2008 Google, Inc. |
| 4 | * Author: Robert Love <rlove@android.com> |
| 5 | * |
| 6 | * This software is licensed under the terms of the GNU General Public |
| 7 | * License version 2, as published by the Free Software Foundation, and |
| 8 | * may be copied, distributed, and modified under those terms. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | */ |
| 16 | |
| 17 | #ifndef _LINUX_LOGGER_H |
| 18 | #define _LINUX_LOGGER_H |
| 19 | |
| 20 | #include <linux/types.h> |
| 21 | #include <linux/ioctl.h> |
| 22 | |
| 23 | struct logger_entry { |
| 24 | __u16 len; /* length of the payload */ |
| 25 | __u16 __pad; /* no matter what, we get 2 bytes of padding */ |
| 26 | __s32 pid; /* generating process's pid */ |
| 27 | __s32 tid; /* generating process's tid */ |
| 28 | __s32 sec; /* seconds since Epoch */ |
| 29 | __s32 nsec; /* nanoseconds */ |
| 30 | char msg[0]; /* the entry's payload */ |
| 31 | }; |
| 32 | |
| 33 | #define LOGGER_LOG_RADIO "log_radio" /* radio-related messages */ |
| 34 | #define LOGGER_LOG_EVENTS "log_events" /* system/hardware events */ |
San Mehat | 3537cda | 2010-02-23 16:09:47 -0800 | [diff] [blame] | 35 | #define LOGGER_LOG_SYSTEM "log_system" /* system/framework messages */ |
Greg Kroah-Hartman | 355b050 | 2011-11-30 20:18:14 +0900 | [diff] [blame] | 36 | #define LOGGER_LOG_MAIN "log_main" /* everything else */ |
| 37 | |
| 38 | #define LOGGER_ENTRY_MAX_LEN (4*1024) |
| 39 | #define LOGGER_ENTRY_MAX_PAYLOAD \ |
| 40 | (LOGGER_ENTRY_MAX_LEN - sizeof(struct logger_entry)) |
| 41 | |
| 42 | #define __LOGGERIO 0xAE |
| 43 | |
| 44 | #define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */ |
| 45 | #define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */ |
| 46 | #define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */ |
| 47 | #define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */ |
| 48 | |
| 49 | #endif /* _LINUX_LOGGER_H */ |