Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sentry to 0.7.9 and make transaction names better #373

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion applications/settings-manager/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int main(int argc, char *argv[]){
if(args.length() == 3 && args.at(2) == "crash"){
trigger_crash();
}else if(args.length() == 3 && args.at(2) == "transaction"){
sentry_transaction("settings", "transaction", [](Transaction* t){
sentry_transaction("Dummy rot transaction", "transaction", [](Transaction* t){
sentry_span(t, "span", "Transaction span", []{
qDebug() << "Triggered transaction";
});
Expand Down
22 changes: 11 additions & 11 deletions applications/system-service/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#endif
startSpan("starting", "Application is starting");
}
Oxide::Sentry::sentry_transaction("application", "launch", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Launch Application", "launch", [this](Oxide::Sentry::Transaction* t){
#ifdef SENTRY
if(t != nullptr){
sentry_transaction_set_tag(t->inner, "application", name().toStdString().c_str());
Expand All @@ -56,7 +56,7 @@
}
updateEnvironment();
umountAll();
if(chroot()){

Check notice on line 59 in applications/system-service/application.cpp

View check run for this annotation

codefactor.io / CodeFactor

applications/system-service/application.cpp#L59

Execution with unnecessary privileges (CWE-250, CWE-22) (flawfinder7-chroot)
mountAll();
m_process->setChroot(chrootPath());
m_process->setWorkingDirectory(chrootPath() + "/" + workingDirectory());
Expand Down Expand Up @@ -123,7 +123,7 @@
return;
}
O_INFO("Pausing " << path());
Oxide::Sentry::sentry_transaction("application", "pause", [this, startIfNone](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Pause Application", "pause", [this, startIfNone](Oxide::Sentry::Transaction* t){
#ifdef SENTRY
if(t != nullptr){
sentry_transaction_set_tag(t->inner, "application", name().toStdString().c_str());
Expand Down Expand Up @@ -151,7 +151,7 @@
){
return;
}
Oxide::Sentry::sentry_transaction("application", "interrupt", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Interrupt Application", "interrupt", [this](Oxide::Sentry::Transaction* t){
#ifdef SENTRY
if(t != nullptr){
sentry_transaction_set_tag(t->inner, "application", name().toStdString().c_str());
Expand Down Expand Up @@ -236,7 +236,7 @@
O_DEBUG("Can't Resume" << path() << "Already running!");
return;
}
Oxide::Sentry::sentry_transaction("application", "resume", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Resume Application", "resume", [this](Oxide::Sentry::Transaction* t){
#ifdef SENTRY
if(t != nullptr){
sentry_transaction_set_tag(t->inner, "application", name().toStdString().c_str());
Expand Down Expand Up @@ -265,7 +265,7 @@
){
return;
}
Oxide::Sentry::sentry_transaction("application", "uninterrupt", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Uninterrupt Application", "uninterrupt", [this](Oxide::Sentry::Transaction* t){
#ifdef SENTRY
if(t != nullptr){
sentry_transaction_set_tag(t->inner, "application", name().toStdString().c_str());
Expand Down Expand Up @@ -320,7 +320,7 @@
if(state == Inactive){
return;
}
Oxide::Sentry::sentry_transaction("application", "stop", [this, state](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Stop Application", "stop", [this, state](Oxide::Sentry::Transaction* t){
#ifdef SENTRY
if(t != nullptr){
sentry_transaction_set_tag(t->inner, "application", name().toStdString().c_str());
Expand Down Expand Up @@ -536,7 +536,7 @@
if(m_screenCapture != nullptr){
return;
}
Oxide::Sentry::sentry_transaction("application", "saveScreen", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Save screen for Application", "saveScreen", [this](Oxide::Sentry::Transaction* t){
O_INFO("Saving screen...");
QByteArray bytes;
Oxide::Sentry::sentry_span(t, "save", "Save the framebuffer", [&bytes]{
Expand Down Expand Up @@ -813,7 +813,7 @@
const QString Application::chrootPath() { return resourcePath() + "/chroot"; }

void Application::mountAll(){
Oxide::Sentry::sentry_transaction("application", "mount", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Mount directories for Application", "mount", [this](Oxide::Sentry::Transaction* t){
#ifdef SENTRY
if(t != nullptr){
sentry_transaction_set_tag(t->inner, "application", name().toStdString().c_str());
Expand Down Expand Up @@ -869,7 +869,7 @@
}

void Application::umountAll(){
Oxide::Sentry::sentry_transaction("application", "umount", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Unmount directories for Application", "umount", [this](Oxide::Sentry::Transaction* t){
#ifdef SENTRY
if(t != nullptr){
sentry_transaction_set_tag(t->inner, "application", name().toStdString().c_str());
Expand Down Expand Up @@ -940,7 +940,7 @@
void Application::showSplashScreen(){
auto frameBuffer = EPFrameBuffer::framebuffer();
O_DEBUG("Waiting for other painting to finish...");
Oxide::Sentry::sentry_transaction("application", "showSplashScreen", [this, frameBuffer](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Show Application Splash Screen", "showSplashScreen", [this, frameBuffer](Oxide::Sentry::Transaction* t){
#ifdef SENTRY
if(t != nullptr){
sentry_transaction_set_tag(t->inner, "application", name().toStdString().c_str());
Expand Down Expand Up @@ -1031,7 +1031,7 @@
return;
}
Oxide::Sentry::sentry_transaction(
"application", "recallScreen", [this](Oxide::Sentry::Transaction *t) {
"Recall Application Screen", "recallScreen", [this](Oxide::Sentry::Transaction *t) {
O_DEBUG("Uncompressing screen...");
QImage img;
Oxide::Sentry::sentry_span(
Expand Down
10 changes: 5 additions & 5 deletions applications/system-service/appsapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ AppsAPI::AppsAPI(QObject* parent)
m_processManagerApplication("/"),
m_taskSwitcherApplication("/"),
m_sleeping(false) {
Oxide::Sentry::sentry_transaction("apps", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Init Apps API", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_span(t, "start", "Launching initial application", [this](Oxide::Sentry::Span* s){
Oxide::Sentry::sentry_span(s, "singleton", "Setup singleton", [this]{
singleton(this);
Expand Down Expand Up @@ -104,7 +104,7 @@ AppsAPI::AppsAPI(QObject* parent)
}

void AppsAPI::startup(){
Oxide::Sentry::sentry_transaction("apps", "startup", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Apps API Startup", "startup", [this](Oxide::Sentry::Transaction* t){
if(applications.isEmpty()){
O_INFO("No applications found");
notificationAPI->errorNotification(_noApplicationsMessage);
Expand Down Expand Up @@ -189,7 +189,7 @@ QDBusObjectPath AppsAPI::registerApplicationNoSecurityCheck(QVariantMap properti
return applications[name]->qPath();
}
QDBusObjectPath path;
Oxide::Sentry::sentry_transaction("apps", "registerApplication", [this, &path, name, properties](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Register Application", "registerApplication", [this, &path, name, properties](Oxide::Sentry::Transaction* t){
Q_UNUSED(t);
path = QDBusObjectPath(getPath(name));
auto app = new Application(path, reinterpret_cast<QObject*>(this));
Expand Down Expand Up @@ -221,7 +221,7 @@ void AppsAPI::reload(){
if(!hasPermission("apps")){
return;
}
Oxide::Sentry::sentry_transaction("apps", "reload", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Reload Apps", "reload", [this](Oxide::Sentry::Transaction* t){
Q_UNUSED(t);
writeApplications();
readApplications();
Expand Down Expand Up @@ -356,7 +356,7 @@ QVariantMap AppsAPI::pausedApplications(){
}

void AppsAPI::unregisterApplication(Application* app){
Oxide::Sentry::sentry_transaction("apps", "unregisterApplication", [this, app](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Unregister Application", "unregisterApplication", [this, app](Oxide::Sentry::Transaction* t){
Q_UNUSED(t);
auto name = app->name();
if(applications.contains(name)){
Expand Down
2 changes: 1 addition & 1 deletion applications/system-service/dbusservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ DBusService::DBusService(QObject* parent) : APIBase(parent), apis(){
#ifdef SENTRY
sentry_breadcrumb("dbusservice", "Initializing APIs", "info");
#endif
Oxide::Sentry::sentry_transaction("dbus", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("DBus Service Init", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_span(t, "apis", "Initialize APIs", [this](Oxide::Sentry::Span* s){
Oxide::Sentry::sentry_span(s, "wifi", "Initialize wifi API", [this]{
apis.insert("wifi", APIEntry{
Expand Down
2 changes: 1 addition & 1 deletion applications/system-service/notificationapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NotificationAPI* NotificationAPI::singleton(NotificationAPI* self){
}

NotificationAPI::NotificationAPI(QObject* parent) : APIBase(parent), notificationDisplayQueue(), m_enabled(false), m_notifications(), m_lock() {
Oxide::Sentry::sentry_transaction("apps", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Notification API init", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_span(t, "singleton", "Setup singleton", [this]{
singleton(this);
});
Expand Down
2 changes: 1 addition & 1 deletion applications/system-service/powerapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PowerAPI* PowerAPI::singleton(PowerAPI* self){

PowerAPI::PowerAPI(QObject* parent)
: APIBase(parent), m_chargerState(ChargerUnknown){
Oxide::Sentry::sentry_transaction("power", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Power API Init", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_span(t, "singleton", "Setup singleton", [this]{
singleton(this);
});
Expand Down
6 changes: 3 additions & 3 deletions applications/system-service/screenapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ QDBusObjectPath ScreenAPI::addScreenshot(QByteArray blob){

Screenshot* ScreenAPI::addScreenshot(QString filePath){
Screenshot* instance;
Oxide::Sentry::sentry_transaction("screen", "addScreenshot", [this, filePath, &instance](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Add Screenshot", "addScreenshot", [this, filePath, &instance](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_span(t, "screenshot", "Create screenshot", [this, filePath, &instance]{
auto path = QString(OXIDE_SERVICE_PATH "/screenshots/") + QFileInfo(filePath).completeBaseName().remove('-').remove('.');
instance = new Screenshot(path, filePath, this);
Expand Down Expand Up @@ -135,7 +135,7 @@ ScreenAPI* ScreenAPI::singleton(ScreenAPI* self){
}

ScreenAPI::ScreenAPI(QObject* parent) : APIBase(parent), m_screenshots(), m_enabled(false) {
Oxide::Sentry::sentry_transaction("screen", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Screen API Init", "init", [this](Oxide::Sentry::Transaction* t){
qDBusRegisterMetaType<QList<double>>();
Oxide::Sentry::sentry_span(t, "mkdirs", "Create screenshots directory", [this]{
mkdirs("/home/root/screenshots/");
Expand Down Expand Up @@ -202,7 +202,7 @@ bool ScreenAPI::drawFullscreenImage(QString path, double rotate) {
img = img.transformed(QTransform().rotate(rotate));
}
Oxide::Sentry::sentry_transaction(
"screen", "drawFullscrenImage",
"Draw Fullscreen Image", "drawFullscrenImage",
[img, path](Oxide::Sentry::Transaction *t) {
Q_UNUSED(t);
Oxide::dispatchToMainThread([img] {
Expand Down
6 changes: 3 additions & 3 deletions applications/system-service/systemapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ QDebug operator<<(QDebug debug, Touch* touch){
void SystemAPI::PrepareForSleep(bool suspending){
auto device = deviceSettings.getDeviceType();
if(suspending){
Oxide::Sentry::sentry_transaction("system", "suspend", [this, device](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Suspend System", "suspend", [this, device](Oxide::Sentry::Transaction* t){
if(autoLock()){
lockTimestamp = QDateTime::currentMSecsSinceEpoch() + lockTimer.remainingTime();
O_DEBUG("Auto Lock timestamp:" << lockTimestamp);
Expand Down Expand Up @@ -66,7 +66,7 @@ void SystemAPI::PrepareForSleep(bool suspending){
O_INFO("Suspending...");
});
}else{
Oxide::Sentry::sentry_transaction("system", "resume", [this, device](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Resume System", "resume", [this, device](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_span(t, "inhibit", "Inhibit sleep", [this]{
inhibitSleep();
});
Expand Down Expand Up @@ -144,7 +144,7 @@ SystemAPI::SystemAPI(QObject* parent)
touches(),
swipeStates(),
swipeLengths() {
Oxide::Sentry::sentry_transaction("system", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("System API Init", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_span(t, "settings", "Sync settings", [this](Oxide::Sentry::Span* s){
Oxide::Sentry::sentry_span(s, "swipes", "Default swipe values", [this]{
for(short i = Right; i <= Down; i++){
Expand Down
2 changes: 1 addition & 1 deletion applications/system-service/wifiapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ WifiAPI::WifiAPI(QObject* parent)
m_link(0),
m_scanning(false)
{
Oxide::Sentry::sentry_transaction("wifi", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Wifi API Init", "init", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_span(t, "singleton", "Setup singleton", [this]{
singleton(this);
});
Expand Down
2 changes: 1 addition & 1 deletion applications/task-switcher/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class Controller : public QObject {
}
void updateImage(){
qDebug() << "Updating background...";
Oxide::Sentry::sentry_transaction("controller", "updateImage", [this](Oxide::Sentry::Transaction* t){
Oxide::Sentry::sentry_transaction("Update Task Switcher Background Image", "updateImage", [this](Oxide::Sentry::Transaction* t){
QImage* img = nullptr;
Oxide::Sentry::sentry_span(t, "previousApplications", "Get image from previous application", [this, &img](Oxide::Sentry::Span* s){
auto previousApplications = appsApi->previousApplications();
Expand Down
2 changes: 1 addition & 1 deletion package
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
pkgnames=(oxide oxide-extra oxide-utils inject_evdev liboxide liboxide-dev libsentry)
_oxidever=$(grep 'VERSION =' qmake/common.pri | awk '{print $3}')
pkgver="$_oxidever~VERSION~"
_sentryver=0.7.6
_sentryver=0.7.9
timestamp="$(date -u +%Y-%m-%dT%H:%MZ)"
maintainer="Eeems <[email protected]>"
url=https://oxide.eeems.codes
Expand Down
4 changes: 3 additions & 1 deletion shared/sentry/sentry.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ PRE_TARGETDEPS += $$OUT_PWD/lib/libsentry.so
sentry_install.target = $$OUT_PWD/lib/libsentry.so
sentry_install.depends = sentry_build
sentry_install.commands = \
cmake --install $$OUT_PWD/src --prefix $$OUT_PWD --config RelWithDebInfo
cmake --install $$OUT_PWD/src \
--prefix $$OUT_PWD \
--config RelWithDebInfo
QMAKE_EXTRA_TARGETS += sentry_install

QMAKE_CLEAN += -r $$OUT_PWD/src/
Expand Down
31 changes: 31 additions & 0 deletions shared/sentry/src/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Changelog

## 0.7.9

**Fixes**:

- Check file-writer construction when writing envelope to path. ([#1036](https://github.com/getsentry/sentry-native/pull/1036))

## 0.7.8

**Features**:

- Let the envelope serialization stream directly to the file. ([#1021](https://github.com/getsentry/sentry-native/pull/1021))
- Support 16kb page sizes on Android 15. ([#1028](https://github.com/getsentry/sentry-native/pull/1028))

## 0.7.7

**Fixes**:

- Further clean up of the exported dependency configuration. ([#1013](https://github.com/getsentry/sentry-native/pull/1013), [crashpad#106](https://github.com/getsentry/crashpad/pull/106))
- Clean-up scope flushing synchronization in crashpad-backend. ([#1019](https://github.com/getsentry/sentry-native/pull/1019), [crashpad#109](https://github.com/getsentry/crashpad/pull/109))
- Rectify user-feedback comment parameter guard. ([#1020](https://github.com/getsentry/sentry-native/pull/1020))

**Internal**:

- Updated `crashpad` to 2024-06-11. ([#1014](https://github.com/getsentry/sentry-native/pull/1014), [crashpad#105](https://github.com/getsentry/crashpad/pull/105))

**Thank you**:

- [@JonLiu1993](https://github.com/JonLiu1993)
- [@dg0yt](https://github.com/dg0yt)
- [@stima](https://github.com/stima)

## 0.7.6

**Fixes**:
Expand Down
16 changes: 9 additions & 7 deletions shared/sentry/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ option(SENTRY_BUILD_EXAMPLES "Build sentry-native example(s)" "${SENTRY_MAIN_PRO

option(SENTRY_LINK_PTHREAD "Link platform threads library" ON)
if(SENTRY_LINK_PTHREAD)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
endif()

Expand Down Expand Up @@ -276,15 +277,15 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
endif()

if(SENTRY_TRANSPORT_CURL)
if(NOT CURL_FOUND) # Some other lib might bring libcurl already
if(NOT TARGET CURL::libcurl) # Some other lib might bring libcurl already
find_package(CURL REQUIRED COMPONENTS AsynchDNS)
endif()

target_link_libraries(sentry PRIVATE CURL::libcurl)
endif()

if(SENTRY_TRANSPORT_COMPRESSION)
if(NOT ZLIB_FOUND)
if(NOT TARGET ZLIB::ZLIB)
find_package(ZLIB REQUIRED)
endif()

Expand Down Expand Up @@ -387,11 +388,7 @@ if(SENTRY_LINK_PTHREAD)
endif()

# apply platform libraries to sentry library
if(SENTRY_LIBRARY_TYPE STREQUAL "STATIC")
target_link_libraries(sentry PUBLIC ${_SENTRY_PLATFORM_LIBS})
else()
target_link_libraries(sentry PRIVATE ${_SENTRY_PLATFORM_LIBS})
endif()
target_link_libraries(sentry PRIVATE ${_SENTRY_PLATFORM_LIBS})

# suppress some errors and warnings for MinGW target
if(MINGW)
Expand Down Expand Up @@ -599,4 +596,9 @@ endif()
if(SENTRY_BUILD_SHARED_LIBS)
target_link_libraries(sentry PRIVATE
"$<$<OR:$<PLATFORM_ID:Linux>,$<PLATFORM_ID:Android>>:-Wl,--build-id=sha1,--version-script=${PROJECT_SOURCE_DIR}/src/exports.map>")

# Support 16KB page sizes
target_link_libraries(sentry PRIVATE
"$<$<PLATFORM_ID:Android>:-Wl,-z,max-page-size=16384>"
)
endif()
4 changes: 2 additions & 2 deletions shared/sentry/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ using `cmake -D BUILD_SHARED_LIBS=OFF ..`.
| | | | | | |
| Backends | | | | | |
| - inproc | ✓ | ✓ | ✓ | ☑ | |
| - crashpad | ☑ | ☑ | | | |
| - breakpad | ✓ | ✓ | | (✓) | (✓) |
| - crashpad | ☑ | ☑ | | | |
| - breakpad | ✓ | ✓ | | (✓) | (✓) |
| - none | ✓ | ✓ | ✓ | ✓ | |

Legend:
Expand Down
Loading