aboutsummaryrefslogtreecommitdiff
path: root/include/linux/bldr_debug_tools.h
blob: 0633726abe0133fd6b81b9b969818e321645e17d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* Copyright 2018  Google, Inc.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __BLDR_DEBUG_TOOLS_H__
#define __BLDR_DEBUG_TOOLS_H__

#include <linux/types.h>

#if defined(CONFIG_BLDR_DEBUG_LOG)
ssize_t bldr_log_read_once(char __user *userbuf, ssize_t klog_size);
ssize_t bldr_last_log_read_once(char __user *userbuf, ssize_t klog_size);
ssize_t bldr_log_read(const void *lastk_buf, ssize_t lastk_size,
		char __user *userbuf, size_t count, loff_t *ppos);
ssize_t bldr_log_total_size(void);
int bldr_log_init(void);
void bldr_log_release(void);
#else
static inline ssize_t bldr_log_read_once(char __user *userbuf,
		ssize_t klog_size) { return 0; }
static inline ssize_t bldr_last_log_read_once(char __user *userbuf,
		ssize_t klog_size) { return 0; }
static inline ssize_t bldr_log_read(const void *lastk_buf, ssize_t lastk_size,
		char __user *userbuf, size_t count, loff_t *ppos) { return 0; }
static inline ssize_t bldr_log_total_size(void) { return 0; }
static inline int bldr_log_init(void) { return 0; }
static inline void bldr_log_release(void) { return; }
#endif

#endif /* __BLDR_DEBUG_TOOLS_H__ */