soc: qcom: ipc_router: Improve IPC attribution

Change the IPC wakelock name to include PID since
complete process name is not printed in many bugreports.
IPC wakelock are of format ipc<port_id>_<PID>_<proc_name>.

Improve debugfs logging to include port_id to service_id mapping
and the amount of transactions on each local port. This information
is helpful in associating a local port with the service ID. This
info is present in /d/dump_local_ports.

CRs-Fixed: 2063352
Change-Id: Id6406f89b3b61066399ef5660b9d2ab37bff6728
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
This commit is contained in:
Dhoat Harpal 2017-06-19 21:26:13 +05:30
parent d4041b86d5
commit 31d0318099
2 changed files with 12 additions and 6 deletions

View file

@ -144,6 +144,7 @@ struct msm_ipc_port {
uint32_t num_rx;
unsigned long num_tx_bytes;
unsigned long num_rx_bytes;
uint32_t last_served_svc_id;
void *priv;
};

View file

@ -364,6 +364,8 @@ static void ipc_router_log_msg(void *log_ctx, uint32_t xchng_type,
svcId = rport_ptr->server->name.service;
svcIns = rport_ptr->server->name.instance;
port_type = CLIENT_PORT;
port_ptr->last_served_svc_id =
rport_ptr->server->name.service;
} else if (port_ptr && (port_ptr->type == SERVER_PORT)) {
svcId = port_ptr->port_name.service;
svcIns = port_ptr->port_name.instance;
@ -1329,8 +1331,9 @@ struct msm_ipc_port *msm_ipc_router_create_raw_port(void *endpoint,
mutex_init(&port_ptr->port_rx_q_lock_lhc3);
init_waitqueue_head(&port_ptr->port_rx_wait_q);
snprintf(port_ptr->rx_ws_name, MAX_WS_NAME_SZ,
"ipc%08x_%s",
"ipc%08x_%d_%s",
port_ptr->this_port.port_id,
task_pid_nr(current),
current->comm);
port_ptr->port_rx_ws = wakeup_source_register(port_ptr->rx_ws_name);
if (!port_ptr->port_rx_ws) {
@ -3867,16 +3870,18 @@ static void dump_local_ports(struct seq_file *s)
int j;
struct msm_ipc_port *port_ptr;
seq_printf(s, "%-11s|%-11s|\n",
"Node_id", "Port_id");
seq_printf(s, "%-11s|%-11s|%-32s|%-11s|\n",
"Node_id", "Port_id", "Wakelock", "Last SVCID");
seq_puts(s, "------------------------------------------------------------\n");
down_read(&local_ports_lock_lhc2);
for (j = 0; j < LP_HASH_SIZE; j++) {
list_for_each_entry(port_ptr, &local_ports[j], list) {
mutex_lock(&port_ptr->port_lock_lhc3);
seq_printf(s, "0x%08x |0x%08x |\n",
port_ptr->this_port.node_id,
port_ptr->this_port.port_id);
seq_printf(s, "0x%08x |0x%08x |%-32s|0x%08x |\n",
port_ptr->this_port.node_id,
port_ptr->this_port.port_id,
port_ptr->rx_ws_name,
port_ptr->last_served_svc_id);
mutex_unlock(&port_ptr->port_lock_lhc3);
}
}