summaryrefstree
path: root/kernel/security/dsms/dsms_debug.c
blob: eb1fe736d14869fb340b9dadd7a91a1e73859a6d (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
/*
 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.
 */

#include <linux/dsms.h>
#include <linux/kernel.h>
#include <linux/printk.h>
#include <linux/string.h>
#include <linux/types.h>

#include "dsms_debug.h"

#ifdef DSMS_DEBUG_ENABLE

#define MAX_ALLOWED_DETAIL_LENGTH 1024

void dsms_debug_message(const char *feature_code, const char *detail,
	int64_t value)
{
	size_t len = strnlen(detail, MAX_ALLOWED_DETAIL_LENGTH);
	printk(DSMS_DEBUG_TAG "{'%s', '%s' (%zu bytes), %lld}", feature_code,
		detail, len, value);
}

#endif //DSMS_DEBUG_ENABLE