mirror of https://github.com/aristocratos/btop.git
Fixed debug timer for gpu
This commit is contained in:
parent
01acfd603e
commit
8bae1ec092
14
src/btop.cpp
14
src/btop.cpp
|
@ -394,7 +394,9 @@ namespace Runner {
|
||||||
|
|
||||||
enum debug_actions {
|
enum debug_actions {
|
||||||
collect_begin,
|
collect_begin,
|
||||||
|
collect_done,
|
||||||
draw_begin,
|
draw_begin,
|
||||||
|
draw_begin_only,
|
||||||
draw_done
|
draw_done
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -430,6 +432,13 @@ namespace Runner {
|
||||||
case collect_begin:
|
case collect_begin:
|
||||||
debug_times[name].at(collect) = time_micros();
|
debug_times[name].at(collect) = time_micros();
|
||||||
return;
|
return;
|
||||||
|
case collect_done:
|
||||||
|
debug_times[name].at(collect) = time_micros() - debug_times[name].at(collect);
|
||||||
|
debug_times["total"].at(collect) += debug_times[name].at(collect);
|
||||||
|
return;
|
||||||
|
case draw_begin_only:
|
||||||
|
debug_times[name].at(draw) = time_micros();
|
||||||
|
return;
|
||||||
case draw_begin:
|
case draw_begin:
|
||||||
debug_times[name].at(draw) = time_micros();
|
debug_times[name].at(draw) = time_micros();
|
||||||
debug_times[name].at(collect) = debug_times[name].at(draw) - debug_times[name].at(collect);
|
debug_times[name].at(collect) = debug_times[name].at(draw) - debug_times[name].at(collect);
|
||||||
|
@ -489,8 +498,6 @@ namespace Runner {
|
||||||
if (debug_bg.empty() or redraw)
|
if (debug_bg.empty() or redraw)
|
||||||
Runner::debug_bg = Draw::createBox(2, 2, 33, 8, "", true, "μs");
|
Runner::debug_bg = Draw::createBox(2, 2, 33, 8, "", true, "μs");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
debug_times.clear();
|
debug_times.clear();
|
||||||
debug_times["total"] = {0, 0};
|
debug_times["total"] = {0, 0};
|
||||||
}
|
}
|
||||||
|
@ -514,6 +521,7 @@ namespace Runner {
|
||||||
if (gpu_in_cpu_panel or not gpu_panels.empty()) {
|
if (gpu_in_cpu_panel or not gpu_panels.empty()) {
|
||||||
if (Global::debug) debug_timer("gpu", collect_begin);
|
if (Global::debug) debug_timer("gpu", collect_begin);
|
||||||
gpus = Gpu::collect(conf.no_update);
|
gpus = Gpu::collect(conf.no_update);
|
||||||
|
if (Global::debug) debug_timer("gpu", collect_done);
|
||||||
}
|
}
|
||||||
auto& gpus_ref = gpus;
|
auto& gpus_ref = gpus;
|
||||||
|
|
||||||
|
@ -548,7 +556,7 @@ namespace Runner {
|
||||||
//? GPU
|
//? GPU
|
||||||
if (not gpu_panels.empty() and not gpus_ref.empty()) {
|
if (not gpu_panels.empty() and not gpus_ref.empty()) {
|
||||||
try {
|
try {
|
||||||
if (Global::debug) debug_timer("gpu", draw_begin);
|
if (Global::debug) debug_timer("gpu", draw_begin_only);
|
||||||
|
|
||||||
//? Draw box
|
//? Draw box
|
||||||
if (not pause_output)
|
if (not pause_output)
|
||||||
|
|
Loading…
Reference in New Issue