print tgid name in /sys/kernel/debug/mali/gpu_memory node
authorJiyu Yang <jiyu.yang@amlogic.com>
Thu, 10 Sep 2015 10:41:30 +0000 (18:41 +0800)
committerJiyu Yang <jiyu.yang@amlogic.com>
Thu, 10 Sep 2015 10:41:30 +0000 (18:41 +0800)
Change-Id: Id754e0e2e2ab3f2f2cadb0868f1f744c5981d8f9
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
mali/common/mali_session.c
mali/linux/mali_kernel_sysfs.c

index dcca264167992932735dc88370b6e52983fedcd5..42b03d8a186084edea688a8e3cb86d916fccb739 100755 (executable)
@@ -8,6 +8,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
+#include <linux/sched.h>
 #include "mali_osk.h"
 #include "mali_osk_list.h"
 #include "mali_session.h"
@@ -87,18 +88,22 @@ u32 mali_session_max_window_num(void)
        return max_window_num;
 }
 #endif
-
 void mali_session_memory_tracking(_mali_osk_print_ctx *print_ctx)
 {
        struct mali_session_data *session, *tmp;
+       char task_comm[TASK_COMM_LEN];
+       struct task_struct *ttask;
        u32 mali_mem_usage;
        u32 total_mali_mem_size;
 
        MALI_DEBUG_ASSERT_POINTER(print_ctx);
        mali_session_lock();
+
        MALI_SESSION_FOREACH(session, tmp, link) {
-               _mali_osk_ctxprintf(print_ctx, "  %-25s  %-10u  %-10u  %-15u  %-15u  %-10u  %-10u\n",
-                                   session->comm, session->pid,
+               ttask = pid_task(find_vpid(session->pid), PIDTYPE_PID);
+               get_task_comm(task_comm, ttask);
+               _mali_osk_ctxprintf(print_ctx, "  %-25s  %-10u %-25s %-10u  %-15u  %-15u  %-10u  %-10u\n",
+                                   session->comm, session->pid,  task_comm,
                                    session->mali_mem_array[MALI_MEM_OS] + session->mali_mem_array[MALI_MEM_BLOCK], session->max_mali_mem_allocated,
                                    session->mali_mem_array[MALI_MEM_EXTERNAL], session->mali_mem_array[MALI_MEM_UMP],
                                    session->mali_mem_array[MALI_MEM_DMA_BUF]);
index ea334c94d233b91b8fc709f444d77e22567c308a..ecde82dd29a04e68a196ca71f318c81d0116bfe5 100755 (executable)
@@ -880,9 +880,9 @@ static const struct file_operations profiling_events_human_readable_fops = {
 
 static int memory_debugfs_show(struct seq_file *s, void *private_data)
 {
-       seq_printf(s, "  %-25s  %-10s  %-10s  %-15s  %-15s  %-10s  %-10s\n"\
-                  "==============================================================================================================\n",
-                  "Name (:bytes)", "pid", "mali_mem", "max_mali_mem",
+       seq_printf(s, "  %-25s  %-10s %-25s %-10s  %-15s  %-15s  %-10s  %-10s\n"\
+                  "=======================================================================================================================================\n",
+                  "Name (:bytes)", "pid", "pid-name", "mali_mem", "max_mali_mem",
                   "external_mem", "ump_mem", "dma_mem");
        mali_session_memory_tracking(s);
        return 0;