Changes in kernel/generic/src/console/cmd.c [e535eeb:d99c1d2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
re535eeb rd99c1d2 66 66 #include <ipc/irq.h> 67 67 #include <ipc/event.h> 68 #include <sysinfo/sysinfo.h>69 68 #include <symtab.h> 70 69 #include <errno.h> … … 388 387 }; 389 388 390 static int cmd_sysinfo(cmd_arg_t *argv);391 static cmd_info_t sysinfo_info = {392 .name = "sysinfo",393 .description = "Dump sysinfo.",394 .func = cmd_sysinfo,395 .argc = 0396 };397 398 389 /* Data and methods for 'zones' command */ 399 390 static int cmd_zones(cmd_arg_t *argv); … … 484 475 &set4_info, 485 476 &slabs_info, 486 &sysinfo_info,487 477 &symaddr_info, 488 478 &sched_info, … … 878 868 } 879 869 880 /** Command for dumping sysinfo 870 871 /** Command for listings Thread information 881 872 * 882 873 * @param argv Ignores … … 884 875 * @return Always 1 885 876 */ 886 int cmd_sysinfo(cmd_arg_t * argv) 887 { 888 sysinfo_dump(NULL); 889 return 1; 890 } 891 877 int cmd_threads(cmd_arg_t * argv) 878 { 879 thread_print_list(); 880 return 1; 881 } 882 883 /** Command for listings Task information 884 * 885 * @param argv Ignores 886 * 887 * @return Always 1 888 */ 889 int cmd_tasks(cmd_arg_t * argv) 890 { 891 task_print_list(); 892 return 1; 893 } 892 894 893 895 /** Command for listings Thread information … … 897 899 * @return Always 1 898 900 */ 899 int cmd_threads(cmd_arg_t * argv)900 {901 thread_print_list();902 return 1;903 }904 905 /** Command for listings Task information906 *907 * @param argv Ignores908 *909 * @return Always 1910 */911 int cmd_tasks(cmd_arg_t * argv)912 {913 task_print_list();914 return 1;915 }916 917 /** Command for listings Thread information918 *919 * @param argv Ignores920 *921 * @return Always 1922 */923 901 int cmd_sched(cmd_arg_t * argv) 924 902 { … … 935 913 int cmd_zones(cmd_arg_t * argv) 936 914 { 937 zone s_print_list();915 zone_print_list(); 938 916 return 1; 939 917 } … … 1049 1027 ipl_t ipl = interrupts_disable(); 1050 1028 spinlock_lock(&TASK->lock); 1051 uint64_t ucycles0, kcycles0; 1052 task_get_accounting(TASK, &ucycles0, &kcycles0); 1029 uint64_t t0 = task_get_accounting(TASK); 1053 1030 spinlock_unlock(&TASK->lock); 1054 1031 interrupts_restore(ipl); … … 1059 1036 1060 1037 /* Update and read thread accounting */ 1061 uint64_t ucycles1, kcycles1;1062 1038 ipl = interrupts_disable(); 1063 1039 spinlock_lock(&TASK->lock); 1064 task_get_accounting(TASK, &ucycles1, &kcycles1);1040 uint64_t dt = task_get_accounting(TASK) - t0; 1065 1041 spinlock_unlock(&TASK->lock); 1066 1042 interrupts_restore(ipl); 1067 1043 1068 uint64_t ucycles, kcycles; 1069 char usuffix, ksuffix; 1070 order_suffix(ucycles1 - ucycles0, &ucycles, &usuffix); 1071 order_suffix(kcycles1 - kcycles0, &kcycles, &ksuffix); 1072 1073 printf("Time: %" PRIu64 "%c user cycles, %" PRIu64 "%c kernel cycles\n", 1074 ucycles, usuffix, kcycles, ksuffix); 1044 uint64_t cycles; 1045 char suffix; 1046 order(dt, &cycles, &suffix); 1047 1048 printf("Time: %" PRIu64 "%c cycles\n", cycles, suffix); 1075 1049 1076 1050 if (ret == NULL) { … … 1087 1061 uint32_t i; 1088 1062 bool ret = true; 1089 uint64_t ucycles, kcycles;1090 char usuffix, ksuffix;1063 uint64_t cycles; 1064 char suffix; 1091 1065 1092 1066 if (cnt < 1) … … 1106 1080 ipl_t ipl = interrupts_disable(); 1107 1081 spinlock_lock(&TASK->lock); 1108 uint64_t ucycles0, kcycles0; 1109 task_get_accounting(TASK, &ucycles0, &kcycles0); 1082 uint64_t t0 = task_get_accounting(TASK); 1110 1083 spinlock_unlock(&TASK->lock); 1111 1084 interrupts_restore(ipl); … … 1118 1091 ipl = interrupts_disable(); 1119 1092 spinlock_lock(&TASK->lock); 1120 uint64_t ucycles1, kcycles1; 1121 task_get_accounting(TASK, &ucycles1, &kcycles1); 1093 uint64_t dt = task_get_accounting(TASK) - t0; 1122 1094 spinlock_unlock(&TASK->lock); 1123 1095 interrupts_restore(ipl); 1124 1096 1125 1097 if (ret != NULL) { 1126 1098 printf("%s\n", ret); … … 1129 1101 } 1130 1102 1131 data[i] = ucycles1 - ucycles0 + kcycles1 - kcycles0; 1132 order_suffix(ucycles1 - ucycles0, &ucycles, &usuffix); 1133 order_suffix(kcycles1 - kcycles0, &kcycles, &ksuffix); 1134 printf("OK (%" PRIu64 "%c user cycles, %" PRIu64 "%c kernel cycles)\n", 1135 ucycles, usuffix, kcycles, ksuffix); 1103 data[i] = dt; 1104 order(dt, &cycles, &suffix); 1105 printf("OK (%" PRIu64 "%c cycles)\n", cycles, suffix); 1136 1106 } 1137 1107 … … 1145 1115 } 1146 1116 1147 order _suffix(sum / (uint64_t) cnt, &ucycles, &usuffix);1148 printf("Average\t\t%" PRIu64 "%c\n", ucycles, usuffix);1117 order(sum / (uint64_t) cnt, &cycles, &suffix); 1118 printf("Average\t\t%" PRIu64 "%c\n", cycles, suffix); 1149 1119 } 1150 1120
Note:
See TracChangeset
for help on using the changeset viewer.