ui stall
This commit is contained in:
Binary file not shown.
+1
-1
@@ -8,5 +8,5 @@ const std::string watchdog_fn_prefix = Path::shm_path() + "/wd_"; // + <pid>
|
||||
|
||||
bool watchdog_kick(uint64_t ts) {
|
||||
static std::string fn = watchdog_fn_prefix + std::to_string(getpid());
|
||||
return util::write_file(fn.c_str(), &ts, sizeof(ts), O_WRONLY | O_CREAT) > 0;
|
||||
return util::write_file(fn.c_str(), &ts, sizeof(ts), O_WRONLY | O_CREAT) == 0;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
extern const uint8_t gitversion[19];
|
||||
const uint8_t gitversion[19] = "DEV-4b5ec507-DEBUG";
|
||||
const uint8_t gitversion[19] = "DEV-96ce4808-DEBUG";
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
DEV-4b5ec507-DEBUG
|
||||
DEV-96ce4808-DEBUG
|
||||
+19
-12
@@ -13,17 +13,6 @@ MainWindow::MainWindow(QWidget *parent) : QWidget(parent) {
|
||||
QObject::connect(homeWindow, &HomeWindow::openSettings, this, &MainWindow::openSettings);
|
||||
QObject::connect(homeWindow, &HomeWindow::closeSettings, this, &MainWindow::closeSettings);
|
||||
|
||||
settingsWindow = new SettingsWindow(this);
|
||||
main_layout->addWidget(settingsWindow);
|
||||
QObject::connect(settingsWindow, &SettingsWindow::closeSettings, this, &MainWindow::closeSettings);
|
||||
QObject::connect(settingsWindow, &SettingsWindow::reviewTrainingGuide, [=]() {
|
||||
onboardingWindow->showTrainingGuide();
|
||||
main_layout->setCurrentWidget(onboardingWindow);
|
||||
});
|
||||
QObject::connect(settingsWindow, &SettingsWindow::showDriverView, [=] {
|
||||
homeWindow->showDriverView(true);
|
||||
});
|
||||
|
||||
onboardingWindow = new OnboardingWindow(this);
|
||||
main_layout->addWidget(onboardingWindow);
|
||||
QObject::connect(onboardingWindow, &OnboardingWindow::onboardingDone, [=]() {
|
||||
@@ -39,7 +28,7 @@ MainWindow::MainWindow(QWidget *parent) : QWidget(parent) {
|
||||
}
|
||||
});
|
||||
QObject::connect(device(), &Device::interactiveTimeout, [=]() {
|
||||
if (main_layout->currentWidget() == settingsWindow) {
|
||||
if (settingsWindow != nullptr && main_layout->currentWidget() == settingsWindow) {
|
||||
closeSettings();
|
||||
}
|
||||
});
|
||||
@@ -65,7 +54,25 @@ MainWindow::MainWindow(QWidget *parent) : QWidget(parent) {
|
||||
setAttribute(Qt::WA_NoSystemBackground);
|
||||
}
|
||||
|
||||
void MainWindow::ensureSettingsWindow() {
|
||||
if (settingsWindow != nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
settingsWindow = new SettingsWindow(this);
|
||||
main_layout->insertWidget(1, settingsWindow);
|
||||
QObject::connect(settingsWindow, &SettingsWindow::closeSettings, this, &MainWindow::closeSettings);
|
||||
QObject::connect(settingsWindow, &SettingsWindow::reviewTrainingGuide, [=]() {
|
||||
onboardingWindow->showTrainingGuide();
|
||||
main_layout->setCurrentWidget(onboardingWindow);
|
||||
});
|
||||
QObject::connect(settingsWindow, &SettingsWindow::showDriverView, [=] {
|
||||
homeWindow->showDriverView(true);
|
||||
});
|
||||
}
|
||||
|
||||
void MainWindow::openSettings(int index, const QString ¶m) {
|
||||
ensureSettingsWindow();
|
||||
main_layout->setCurrentWidget(settingsWindow);
|
||||
settingsWindow->setCurrentPanel(index, param);
|
||||
}
|
||||
|
||||
@@ -15,12 +15,13 @@ public:
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
void ensureSettingsWindow();
|
||||
void openSettings(int index = 0, const QString ¶m = "");
|
||||
void closeSettings();
|
||||
|
||||
QStackedLayout *main_layout;
|
||||
HomeWindow *homeWindow;
|
||||
SettingsWindow *settingsWindow;
|
||||
SettingsWindow *settingsWindow = nullptr;
|
||||
OnboardingWindow *onboardingWindow;
|
||||
|
||||
Params params;
|
||||
|
||||
@@ -3,6 +3,7 @@ import sys
|
||||
import time
|
||||
import traceback
|
||||
import threading
|
||||
from collections import deque
|
||||
from pathlib import Path
|
||||
|
||||
from openpilot.common.swaglog import cloudlog
|
||||
@@ -32,6 +33,8 @@ class UIStallMonitor:
|
||||
self._stalled_phase = self._phase
|
||||
|
||||
self._lock = threading.Lock()
|
||||
self._history = deque(maxlen=max(1, int(os.getenv("UI_STALL_HISTORY_LEN", "64"))))
|
||||
self._history.append((now, self._phase))
|
||||
self._stop_event = threading.Event()
|
||||
self._thread = threading.Thread(target=self._run, name=f"{name}_stall_probe", daemon=True)
|
||||
|
||||
@@ -54,6 +57,7 @@ class UIStallMonitor:
|
||||
if phase != self._phase:
|
||||
self._phase = phase
|
||||
self._phase_entered = now
|
||||
self._history.append((now, phase))
|
||||
self._last_progress = now
|
||||
|
||||
if self._stall_reported:
|
||||
@@ -101,6 +105,15 @@ class UIStallMonitor:
|
||||
"",
|
||||
]
|
||||
|
||||
with self._lock:
|
||||
history = list(self._history)
|
||||
|
||||
lines.append("Recent phase transitions:")
|
||||
for ts, phase_name in history:
|
||||
age_s = now - ts
|
||||
lines.append(f" - {ts:.6f} ({age_s:.3f}s ago) {phase_name}")
|
||||
lines.append("")
|
||||
|
||||
ordered_idents = sorted(frames.keys(), key=lambda ident: ident != self._main_thread_id)
|
||||
for ident in ordered_idents:
|
||||
thread = threads.get(ident)
|
||||
|
||||
Binary file not shown.
@@ -569,13 +569,19 @@ class GuiApplication:
|
||||
continue
|
||||
|
||||
if self._render_texture:
|
||||
self._mark_progress("gui_app.begin_texture_mode")
|
||||
self._mark_progress("gui_app.before_begin_texture_mode")
|
||||
rl.begin_texture_mode(self._render_texture)
|
||||
self._mark_progress("gui_app.after_begin_texture_mode")
|
||||
self._mark_progress("gui_app.before_clear_background")
|
||||
rl.clear_background(rl.BLACK)
|
||||
self._mark_progress("gui_app.after_clear_background")
|
||||
else:
|
||||
self._mark_progress("gui_app.begin_drawing")
|
||||
self._mark_progress("gui_app.before_begin_drawing")
|
||||
rl.begin_drawing()
|
||||
self._mark_progress("gui_app.after_begin_drawing")
|
||||
self._mark_progress("gui_app.before_clear_background")
|
||||
rl.clear_background(rl.BLACK)
|
||||
self._mark_progress("gui_app.after_clear_background")
|
||||
|
||||
# Handle modal overlay rendering and input processing
|
||||
if self._render_nav_stack():
|
||||
@@ -594,19 +600,24 @@ class GuiApplication:
|
||||
if self._render_texture:
|
||||
self._mark_progress("gui_app.end_texture_mode")
|
||||
rl.end_texture_mode()
|
||||
self._mark_progress("gui_app.begin_present")
|
||||
self._mark_progress("gui_app.before_present_begin_drawing")
|
||||
rl.begin_drawing()
|
||||
self._mark_progress("gui_app.after_present_begin_drawing")
|
||||
self._mark_progress("gui_app.before_present_clear_background")
|
||||
rl.clear_background(rl.BLACK)
|
||||
self._mark_progress("gui_app.after_present_clear_background")
|
||||
src_rect = rl.Rectangle(0, 0, float(self._width), -float(self._height))
|
||||
dst_rect = rl.Rectangle(0, 0, float(self._scaled_width), float(self._scaled_height))
|
||||
texture = self._render_texture.texture
|
||||
if texture:
|
||||
self._mark_progress("gui_app.before_present_draw_texture")
|
||||
if BURN_IN_MODE and self._burn_in_shader:
|
||||
rl.begin_shader_mode(self._burn_in_shader)
|
||||
rl.draw_texture_pro(texture, src_rect, dst_rect, rl.Vector2(0, 0), 0.0, rl.WHITE)
|
||||
rl.end_shader_mode()
|
||||
else:
|
||||
rl.draw_texture_pro(texture, src_rect, dst_rect, rl.Vector2(0, 0), 0.0, rl.WHITE)
|
||||
self._mark_progress("gui_app.after_present_draw_texture")
|
||||
|
||||
if self._show_fps:
|
||||
rl.draw_fps(10, 10)
|
||||
|
||||
Reference in New Issue
Block a user