Commit Graph

154 Commits

Author SHA1 Message Date
Steveice10
3fedc68230
common: Only use libbacktrace if present. (#6827) 2023-07-31 14:24:27 -07:00
Steveice10
662bb9ba77
hle: Stub some service calls used by the home menu. (#6675) 2023-07-07 22:05:38 -07:00
GPUCode
d7b4260389 common: Address feedback 2023-07-03 17:13:00 +03:00
GPUCode
ba98bf058a logging: Address some issues 2023-07-03 02:18:35 +03:00
Morph
0ddb095273 logging: Make use of bounded queue 2023-06-30 12:15:52 +03:00
ameerj
52b9007fcf common: Reduce unused includes 2023-06-30 12:15:52 +03:00
Merry
e112421db8 backend: Ensure backend_thread is destructed before message_queue
Ensures that stop_token signals that stop has been requested before destruction of conditional_variable
2023-06-30 12:15:52 +03:00
Wunkolo
ae6fda8638 logging: Convert backend_thread into an std::jthread
Was getting an unhandled `invalid_argument` [exception](https://en.cppreference.com/w/cpp/thread/thread/join) during
shutdown on my linux machine. This removes the need for a `StopBackendThread` function entirely since `jthread`
[automatically handles both checking if the thread is joinable and stopping the token before attempting to join](https://en.cppreference.com/w/cpp/thread/jthread/~jthread) in the case that `StartBackendThread` was never called.
2023-06-30 12:15:52 +03:00
Levi Behunin
197c1adcba Refactor Logging Impl
Loop on stop_token and remove final_entry in Entry.
Move Backend thread out of Impl Constructor to its own function.
Add Start function for backend thread.
Use stop token in PopWait and check if entry filename is nullptr before logging.
2023-06-30 12:15:52 +03:00
ameerj
a1443356f1 threadsafe_queue: Add std::stop_token overload to PopWait
Useful for jthreads which make use of the threadsafe queues.
2023-06-30 12:15:52 +03:00
ameerj
aa39430e2c common/logging: Reduce scope of fmt include 2023-06-30 12:15:52 +03:00
ameerj
8f51dd9513 common/logging: Move Log::Entry declaration to a separate header
This reduces the load of requiring to include std::chrono in all files which include log.h
2023-06-30 12:15:52 +03:00
ameerj
98e9f4c32e logging: Fix log filter during initialization
The log filter was being ignored on initialization due to the logging instance being initialized before the config instance, so the log filter was set to its default value.

This fixes that oversight, along with using descriptive exceptions instead of abort() calls.
2023-06-30 12:15:51 +03:00
yzct12345
a8340395a3 logging: Display backtrace on crash
This implements backtraces so we don't have to tell users how to use gdb anymore.

This prints a backtrace after abort or segfault is detected. It also fixes the log getting cut off with the last line containing only a bracket. This change lets us know what caused a crash not just what happened the few seconds before it.

I only know how to add support for Linux with GCC. Also this doesn't work outside of C/C++ such as in dynarmic or certain parts of graphics drivers. The good thing is that it'll try and just crash again but the stack frames are still there so the core dump will work just like before.
2023-06-30 12:15:51 +03:00
yzct12345
3641b9891d logging: Simplify and make thread-safe
This simplifies the logging system.

This also fixes some lost messages on startup.

The simplification is simple. I removed unused functions and moved most things in the .h to the .cpp. I replaced the unnecessary linked list with its contents laid out as three member variables. Anything that went through the linked list now directly accesses the backends. Generic functions are replaced with those for each specific use case and there aren't many. This change increases coupling but we gain back more KISS and encapsulation.

With those changes it was easy to make it thread-safe. I just removed the mutex and turned a boolean atomic. I was planning to use this thread-safety in my next PR about stacktraces. It was actually async-signal-safety at first but I ended up using a different approach. Anyway getting rid of the linked list is important for that because have the list of backends constantly changing complicates things.
2023-06-30 12:15:51 +03:00
Morph
8e8ca7d9d0 common: logging: backend: Close the file after exceeding the write limit
There's no point in keeping the file open after the write limit is exceeded. This allows the file to be committed to the disk shortly after it is closed and avoids redundantly checking whether or not the write limit is exceeded.
2023-06-30 12:15:51 +03:00
Morph
b57773b1cf common: logging: Restructure backend code 2023-06-30 12:15:51 +03:00
Morph
b559c078bc common: logging: backend: Wrap IOFile in a unique_ptr
Allows us to forward declare FileUtil::IOFile.
2023-06-30 12:15:51 +03:00
Lioncash
5c86147ef4 log/backend: Use in-class initializer for FileBackend
We can also avoid redundant constructions of the same string repeatedly.
2023-06-30 12:15:51 +03:00
Lioncash
399f3d4e32 log/backend: Make use of erase_if
Same behavior, but less verbose.
2023-06-30 12:15:51 +03:00
Lioncash
173b84c8ff log/backend: Correct order of const in copy constructor
Follows our predominant coding style. Also explicitly specifies the move
constructor/assignment operator as well.
2023-06-30 12:15:51 +03:00
Lioncash
b4c38372d1 common/log: Move Log namespace into the Common namespace
Forgot to move this over when I moved the rest of the source files with
lacking namespaces over.
2023-06-30 12:15:51 +03:00
Lioncash
4fd0cbebdb logging/backend: Make use of designated initializers
Same behavior, less code.
2023-06-30 12:15:36 +03:00
Steveice10
2d6aca4563
build: Rework CI and move all bundling into new build target. (#6556)
* build: Rework CI and move all bundling into new build target.

* ci: Use "mingw" in msys2 release names for compatibility.

* ci: Use "osx" in macOS release names for compatibility.

* ci: Disable macOS upload.

Will be moved to a separate PR for canary merge.
2023-06-26 17:42:00 -07:00
GPUCode
d735f5c458
renderer_vulkan: Add vulkan initialization code (#6620)
* common: Move dynamic library to common

* This is so that video_core can use it

* logging: Add vulkan log target

* common: Allow defered library loading

* Also add some comments to the functions

* renderer_vulkan: Add vulkan initialization code

* renderer_vulkan: Address feedback
2023-06-20 15:24:24 +03:00
Vitor K
34de77d429
Various miscelaneous changes (#6496) 2023-05-03 17:24:10 +02:00
SachinVin
41f13456c0
Chore: Enable warnings as errors on MSVC (#6456)
* tests: add Sanity test for SplitFilename83

fix test

fix test

* disable `C4715:not all control paths return a value` for nihstro includes

nihstro: no warn

* Chore: Enable warnings as errors on msvc + fix warnings

fixes

some more warnings

clang-format

* more fixes

* Externals: Add target_compile_options `/W0` nihstro-headers and ...

Revert "disable `C4715:not all control paths return a value` for nihstro includes"
This reverts commit 606d79b55d3044b744fb835025b8eb0f4ea5b757.

* src\citra\config.cpp: ReadSetting: simplify type casting

* settings.cpp: Get*Name: remove superflous logs
2023-05-01 22:38:58 +03:00
Steveice10
78cb48b23c
common: Make TrimSourcePath constexpr (#6279) 2023-02-03 19:01:10 +01:00
PabloMK7
016ce6c286
Add 3GX plugin loader (#6172)
* Initial plugin loader support

* More plugin loader progress

* Organize code and more plugin features

* Fix clang-format

* Fix compilation and add android gui

* Fix clang-format

* Fix macos build

* Fix copy-paste bug and clang-format

* More merge fixes

* Make suggestions

* Move global variable to static member

* Fix typo

* Apply suggestions

* Proper initialization order

* Allocate plugin memory from SYSTEM instead of APPLICATION

* Do not mark free pages as RWX

* Fix plugins in old 3DS mode.

* Implement KernelSetState and notif 0x203

* Apply changes

* Remove unused variable

* Fix dynarmic commit

* Sublicense files with MIT License

* Remove non-ascii characters from license
2022-12-11 10:08:58 +02:00
GPUCode
cbd5d1c15c
Upgrade codebase to C++ 20 + fix warnings + update submodules (#6115) 2022-09-21 18:36:12 +02:00
SachinVin
9ad6bc29b5 common/logging: Create a new backed for android's logcat
logging
2021-10-02 16:38:18 +05:30
bunnei
4cc8d43fa1 android: log: TrimSourcePath: Cannot be constexpr. 2021-09-29 22:51:14 +05:30
James Rowe
9f4501aceb Perf: Remove more breakpoint checking in the interpreter. Move filtering earlier in the logging chain 2021-07-24 23:36:56 +05:30
xperia64
c1d7ba4d60
Delete the old log file before rotating (#5675) 2021-01-03 14:53:23 -05:00
bunnei
9c76120a13
Fix the old log file to work with the log parser. 2021-01-01 03:17:20 -08:00
xperia64
b4a6763484 Rotate previous log file to '.old' if it exists 2020-12-31 16:10:01 -05:00
Valentin Vanelslande
41abdb505c
common/logging/log: Add LLE in Audio_DSP comment (#5327)
@wwylele forgot to add it in https://github.com/citra-emu/citra/pull/4490.
2020-05-04 12:20:56 +02:00
BreadFish64
e7a073e15f logging/backend: Change type of filename from string to const char*
This was suggested by degasus in https://github.com/yuzu-emu/yuzu/pull/3326 in order to avoid an unnecessary copy.
2020-01-28 14:29:26 +01:00
BreadFish64
b3beff0f4c common/logging: don't use regex for path trimming 2019-12-24 14:19:18 -06:00
ReinUsesLisp
30be149f87 common/logging: Silence no return value warnings 2019-11-19 16:47:35 +01:00
bunnei
1c61f066d1 android: common: logging: Add log output support. 2019-07-07 11:01:13 -04:00
Pengfei Zhu
37861526ff
Merge pull request #4733 from zhaowenlan1779/ps
service/ps: Implement PS:EncryptDecryptAes
2019-04-29 21:39:53 +08:00
zhupengfei
b34847d59e
service/ps: Implement PS:EncryptDecryptAES 2019-04-15 22:56:55 +08:00
Weiyi Wang
4a206237be
Merge pull request #4726 from FearlessTobi/port-2312
Port yuzu-emu/yuzu#2312: "general: Use deducation guides for std::lock_guard and std::unique_lock"
2019-04-13 18:00:09 -04:00
Lioncash
21c71d21ae general: Use deducation guides for std::lock_guard and std::unique_lock
Since C++17, the introduction of deduction guides for locking facilities
means that we no longer need to hardcode the mutex type into the locks
themselves, making it easier to switch mutex types, should it ever be
necessary in the future.
2019-04-07 15:14:29 +02:00
Lioncash
592ec9b084 logging/backend: Make time_origin a class variable instead of a local static
Moves local global state into the Impl class itself and initializes it
at the creation of the instance instead of in the function.

This makes it nicer for weakly-ordered architectures, given the
CreateEntry() class won't need to have atomic loads executed for each
individual call to the CreateEntry class.
2019-03-17 23:17:57 +01:00
Lioncash
235fc348af logging/backend: Move CreateEntry into the Impl class
This function is only ever used within this source file and makes it
easier to remove static state in the following change.
2019-03-17 23:17:57 +01:00
BreadFish64
36e368ff99 remove Common::TrimSourcePath
wwylele / 白疾風Today at 6:14 PM
I doubt the performance of constructing regex everytime the function is called
Is TrimSourcePath only called by logging? if so, you can move the implementation into logging, and cache the regex object into global
This function is probably too specific to be in common anyway
2019-03-10 19:18:09 -05:00
BreadFish64
f767b5fdef android: add logging 2019-03-09 18:23:32 -06:00
Carl Kenner
3d083859c1 logging: Add DebuggerBackend for logging to Visual Studio 2018-12-01 12:54:17 +01:00