dm: tpm: Convert print output to acrn-dm logger

Refine the DPRINTF/WPRINTF to pr_* based log interface for better log management.

Tracked-On: #5267
Signed-off-by: Sun Peng <peng.p.sun@intel.com>
Reviewed-by: Chi Mingqiang <mingqiang.chi@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Sun Peng 2020-08-28 05:18:52 +00:00 committed by wenlingz
parent 57dd678632
commit a692df46c1
2 changed files with 6 additions and 4 deletions

View File

@ -13,13 +13,14 @@
#include "vmmapi.h" #include "vmmapi.h"
#include "tpm.h" #include "tpm.h"
#include "tpm_internal.h" #include "tpm_internal.h"
#include "log.h"
static int tpm_debug; static int tpm_debug;
#define LOG_TAG "tpm: " #define LOG_TAG "tpm: "
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, args...) \
do { if (tpm_debug) printf(LOG_TAG "%s:" fmt, __func__, ##args); } while (0) do { if (tpm_debug) pr_dbg(LOG_TAG "%s:" fmt, __func__, ##args); } while (0)
#define WPRINTF(fmt, args...) \ #define WPRINTF(fmt, args...) \
do { printf(LOG_TAG "%s:" fmt, __func__, ##args); } while (0) do { pr_err(LOG_TAG "%s:" fmt, __func__, ##args); } while (0)
#define STR_MAX_LEN 1024U #define STR_MAX_LEN 1024U
static char *sock_path = NULL; static char *sock_path = NULL;

View File

@ -17,13 +17,14 @@
#include "mem.h" #include "mem.h"
#include "tpm.h" #include "tpm.h"
#include "tpm_internal.h" #include "tpm_internal.h"
#include "log.h"
static int tpm_crb_debug; static int tpm_crb_debug;
#define LOG_TAG "tpm_crb: " #define LOG_TAG "tpm_crb: "
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, args...) \
do { if (tpm_crb_debug) printf(LOG_TAG "%s: " fmt, __func__, ##args); } while (0) do { if (tpm_crb_debug) pr_dbg(LOG_TAG "%s: " fmt, __func__, ##args); } while (0)
#define WPRINTF(fmt, args...) \ #define WPRINTF(fmt, args...) \
do { printf(LOG_TAG "%s: " fmt, __func__, ##args); } while (0) do { pr_err(LOG_TAG "%s: " fmt, __func__, ##args); } while (0)
#define __packed __attribute__((packed)) #define __packed __attribute__((packed))