Skip to content

Commit

Permalink
Update sentry to 0.7.9 and make transaction names better
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Sep 19, 2024
1 parent 769ab66 commit cb78c48
Show file tree
Hide file tree
Showing 192 changed files with 4,950 additions and 1,209 deletions.
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 @@ void Application::launchNoSecurityCheck(){
#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 Down Expand Up @@ -123,7 +123,7 @@ void Application::pauseNoSecurityCheck(bool startIfNone){
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 @@ void Application::interruptApplication(){
){
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 @@ void Application::resumeNoSecurityCheck(){
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 @@ void Application::uninterruptApplication(){
){
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 @@ void Application::stopNoSecurityCheck(){
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 @@ void Application::saveScreen(){
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::resourcePath() { return "/tmp/tarnish-chroot/" + name
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::mountAll(){
}

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 @@ QStringList Application::getActiveMounts(){
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 @@ void Application::recallScreen() {
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/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/system-service/wpa_supplicant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -N -p wpa_supplicant.h:wpa_supplicant.cpp fi.w1.wpa_supplicant1.xml
*
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
Expand Down
2 changes: 1 addition & 1 deletion applications/system-service/wpa_supplicant.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -N -p wpa_supplicant.h:wpa_supplicant.cpp fi.w1.wpa_supplicant1.xml
*
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
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
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
7 changes: 6 additions & 1 deletion shared/sentry/src/external/crashpad/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Keep sorted

*.Makefile
*.ninja
*.pyc
*.target.mk
*.xcodeproj
*~
.*.sw?
.cache
.DS_Store
.cache
.gdb_history
.gdbinit
/Makefile
/build/fuchsia
/out
/third_party/edo/edo
/third_party/fuchsia-gn-sdk
/third_party/fuchsia/.cipd
/third_party/fuchsia/clang
/third_party/fuchsia/qemu
/third_party/fuchsia/sdk
/third_party/googletest/googletest
/third_party/gyp/gyp
/third_party/libfuzzer
/third_party/linux/.cipd
/third_party/linux/clang
Expand Down
Loading

0 comments on commit cb78c48

Please sign in to comment.