diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index a11cff9350..61698f5025 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -151,25 +151,21 @@ static const char* threads_getname(int selected_item, void *data, | |||
151 | selected_item -= NUM_CORES; | 151 | selected_item -= NUM_CORES; |
152 | #endif | 152 | #endif |
153 | 153 | ||
154 | const char *fmtstr = "%2d: ---"; | ||
155 | |||
154 | struct thread_debug_info threadinfo; | 156 | struct thread_debug_info threadinfo; |
155 | if (thread_get_debug_info(selected_item, &threadinfo) <= 0) | 157 | if (thread_get_debug_info(selected_item, &threadinfo) > 0) |
156 | { | 158 | { |
157 | snprintf(buffer, buffer_len, "%2d: ---", selected_item); | 159 | fmtstr = "%2d:" IF_COP(" (%d)") " %s" IF_PRIO(" %d %d") |
158 | return buffer; | 160 | IFN_SDL(" %2d%%") " %s"; |
159 | } | 161 | } |
160 | 162 | ||
161 | snprintf(buffer, buffer_len, | 163 | snprintf(buffer, buffer_len, fmtstr, |
162 | "%2d: " IF_COP("(%d) ") "%s " IF_PRIO("%d %d ") "%2d%% %s", | ||
163 | selected_item, | 164 | selected_item, |
164 | #if NUM_CORES > 1 | 165 | IF_COP(threadinfo.core,) |
165 | threadinfo.core, | ||
166 | #endif | ||
167 | threadinfo.statusstr, | 166 | threadinfo.statusstr, |
168 | #ifdef HAVE_PRIORITY_SCHEDULING | 167 | IF_PRIO(threadinfo.base_priority, threadinfo.current_priority,) |
169 | threadinfo.base_priority, | 168 | IFN_SDL(threadinfo.stack_usage,) |
170 | threadinfo.current_priority, | ||
171 | #endif | ||
172 | threadinfo.stack_usage, | ||
173 | threadinfo.name); | 169 | threadinfo.name); |
174 | 170 | ||
175 | return buffer; | 171 | return buffer; |
@@ -187,16 +183,9 @@ static bool dbg_os(void) | |||
187 | { | 183 | { |
188 | struct simplelist_info info; | 184 | struct simplelist_info info; |
189 | simplelist_info_init(&info, IF_COP("Core and ") "Stack usage:", | 185 | simplelist_info_init(&info, IF_COP("Core and ") "Stack usage:", |
190 | #if NUM_CORES == 1 | 186 | MAXTHREADS IF_COP( + NUM_CORES ), NULL); |
191 | MAXTHREADS, | ||
192 | #else | ||
193 | MAXTHREADS+NUM_CORES, | ||
194 | #endif | ||
195 | NULL); | ||
196 | #ifndef ROCKBOX_HAS_LOGF | ||
197 | info.hide_selection = true; | 187 | info.hide_selection = true; |
198 | info.scroll_all = true; | 188 | info.scroll_all = true; |
199 | #endif | ||
200 | info.action_callback = dbg_threads_action_callback; | 189 | info.action_callback = dbg_threads_action_callback; |
201 | info.get_name = threads_getname; | 190 | info.get_name = threads_getname; |
202 | return simplelist_show_list(&info); | 191 | return simplelist_show_list(&info); |