summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0001-peci-Add-debug-printing-to-check-caller-PID.patch
blob: fbd51df7a3f862de165378740f02b03425693ac5 (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
39
40
41
42
43
From 7474fe190f770e064a5ce5e939bd713ce2aa1de5 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Date: Wed, 3 Feb 2021 16:18:37 -0800
Subject: [PATCH] peci: Add debug printing to check caller PID

This commit adds debug printing out to check caller PID for traffic
profiling.

The printing can be enabled by this command:
echo -n 'file drivers/peci/peci-core.c line 218 +p' > /sys/kernel/debug/dynamic_debug/control
echo '8' > /proc/sys/kernel/printk

Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
 drivers/peci/peci-core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/peci/peci-core.c b/drivers/peci/peci-core.c
index 10375e6087a5..02c8502fd846 100644
--- a/drivers/peci/peci-core.c
+++ b/drivers/peci/peci-core.c
@@ -194,6 +194,7 @@ static int __peci_xfer(struct peci_adapter *adapter, struct peci_xfer_msg *msg,
 		       bool do_retry, bool has_aw_fcs)
 {
 	uint interval_us = PECI_DEV_RETRY_INTERVAL_MIN_USEC;
+	char task_name[TASK_COMM_LEN];
 	ulong timeout = jiffies;
 	u8 aw_fcs;
 	int ret;
@@ -214,6 +215,10 @@ static int __peci_xfer(struct peci_adapter *adapter, struct peci_xfer_msg *msg,
 		}
 	}
 
+	get_task_comm(task_name, current);
+	dev_dbg(&adapter->dev, "%s is called by %s(%d) through %s\n",
+		__func__, task_name, current->pid, adapter->name);
+
 	/*
 	 * For some commands, the PECI originator may need to retry a command if
 	 * the processor PECI client responds with a 0x8x completion code. In
-- 
2.17.1