linux/drivers/staging/android/logger.h
<<
>>
Prefs
   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/**
  24 * struct logger_entry - defines a single entry that is given to a logger
  25 * @len:        The length of the payload
  26 * @__pad:      Two bytes of padding that appear to be required
  27 * @pid:        The generating process' process ID
  28 * @tid:        The generating process' thread ID
  29 * @sec:        The number of seconds that have elapsed since the Epoch
  30 * @nsec:       The number of nanoseconds that have elapsed since @sec
  31 * @msg:        The message that is to be logged
  32 */
  33struct logger_entry {
  34        __u16           len;
  35        __u16           __pad;
  36        __s32           pid;
  37        __s32           tid;
  38        __s32           sec;
  39        __s32           nsec;
  40        char            msg[0];
  41};
  42
  43#define LOGGER_LOG_RADIO        "log_radio"     /* radio-related messages */
  44#define LOGGER_LOG_EVENTS       "log_events"    /* system/hardware events */
  45#define LOGGER_LOG_SYSTEM       "log_system"    /* system/framework messages */
  46#define LOGGER_LOG_MAIN         "log_main"      /* everything else */
  47
  48#define LOGGER_ENTRY_MAX_LEN            (4*1024)
  49#define LOGGER_ENTRY_MAX_PAYLOAD        \
  50        (LOGGER_ENTRY_MAX_LEN - sizeof(struct logger_entry))
  51
  52#define __LOGGERIO      0xAE
  53
  54#define LOGGER_GET_LOG_BUF_SIZE         _IO(__LOGGERIO, 1) /* size of log */
  55#define LOGGER_GET_LOG_LEN              _IO(__LOGGERIO, 2) /* used log len */
  56#define LOGGER_GET_NEXT_ENTRY_LEN       _IO(__LOGGERIO, 3) /* next entry len */
  57#define LOGGER_FLUSH_LOG                _IO(__LOGGERIO, 4) /* flush log */
  58
  59#endif /* _LINUX_LOGGER_H */
  60