samsung: itmon: modify to find master IPs
authorHosung Kim <hosung0.kim@samsung.com>
Mon, 2 Jul 2018 08:00:41 +0000 (17:00 +0900)
committerSangwook Ju <sw.ju@samsung.com>
Tue, 3 Jul 2018 12:36:39 +0000 (21:36 +0900)
This commit modified to find master IPs with M-node.

Change-Id: I8c96b59aea342e724e15accf2a58fe2aa99ea777
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
drivers/soc/samsung/debug/exynos9610-itmon.c

index 192af0b453142c9d13b49cbf0fa3aa4a1b37545e..99f8a1e7a64e79fd87a28a8ae45ceb59b29a8295 100644 (file)
@@ -891,42 +891,35 @@ static void itmon_report_tracedata(struct itmon_dev *itmon,
                /*
                 * In DECERR case, the follow information was already filled in M_NODE.
                 */
-               if (group->bus_type == BUS_PERI) {
-                       traceinfo->dest = node->name;
-                       val = axid & (BIT(0) | BIT(1));
-                       if (val == FROM_CP) {
-                               master = (struct itmon_masterinfo *)
-                                               itmon_get_masterinfo(itmon, CP_COMMON_STR,
-                                               axid >> 2);
-                               if (!traceinfo->port)
-                                       traceinfo->port = CP_COMMON_STR;
-                               if (master)
-                                       traceinfo->master = master->master_name;
-
-                       } else if (val == FROM_CPU) {
-                               if (!traceinfo->port)
-                                       traceinfo->port = CP_COMMON_STR;
-                       } else if (val == FROM_PERI) {
-                               if (!traceinfo->port)
-                                       traceinfo->port = "refer other node information";
-                       }
-               } else {
-                       /* If it has traceinfo->port, keep previous information */
-                       port = (struct itmon_rpathinfo *) itmon_get_rpathinfo(itmon, axid, node->name);
-                       if (port) {
-                               traceinfo->port = port->port_name;
-                               master = (struct itmon_masterinfo *)
-                                               itmon_get_masterinfo(itmon, traceinfo->port,
-                                                       axid >> port->shift_bits);
-                               if (master)
-                                       traceinfo->master = master->master_name;
-                       } else {
-                               if (!traceinfo->port)
-                                       traceinfo->port = "Unknown";
-                               if (!traceinfo->master)
-                                       traceinfo->master = "Unknown";
+               port = (struct itmon_rpathinfo *) itmon_get_rpathinfo(itmon, axid, node->name);
+
+               if (port) {
+                       struct itmon_nodeinfo *m_node, *next_m_node;
+                       struct itmon_tracedata *m_tracedata;
+                       unsigned int m_axid;
+
+                       traceinfo->port = port->port_name;
+                       list_for_each_entry_safe(m_node, next_m_node,
+                                       &pdata->tracelist[trans_type], list) {
+                               if (m_node && m_node->name && port->port_name && m_node->type == M_NODE &&
+                                       strncmp(m_node->name, port->port_name,
+                                               strlen(port->port_name)) == 0) {
+                                       m_tracedata = &m_node->tracedata;
+                                       m_axid = BIT_AXID(m_tracedata->int_info);
+                                       master = (struct itmon_masterinfo *)
+                                               itmon_get_masterinfo(itmon, traceinfo->port, m_axid);
+                                       if (master) {
+                                               traceinfo->master = master->master_name;
+                                               break;
+                                       }
+                               }
                        }
                }
+               if (!traceinfo->port)
+                       traceinfo->port = "Unknown";
+               if (!traceinfo->master)
+                       traceinfo->master = "Unknown";
+
                traceinfo->target_addr =
                        (((unsigned long)node->tracedata.ext_info_1
                        & GENMASK(3, 0)) << 32ULL);