Commit graph

56 commits

Author SHA1 Message Date
Morph
99ceb03a1c general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
ameerj
7c4b6aab2e core: Remove unused includes 2021-11-03 21:42:57 -04:00
ameerj
422a15ee75 lm: Demote guest logs to LOG_DEBUG
Guest logs are not very useful, as they are intended for use by the game developers during development. As such, they provide little meaning to be logged by yuzu and tend to overwhelm the log output at times.
2021-06-14 22:23:27 -04:00
Morph
12c1766997 general: Replace RESULT_SUCCESS with ResultSuccess
Transition to PascalCase for result names.
2021-06-02 00:39:27 -04:00
Lioncash
29cd40bded lm: Make use of insert_or_assign() in Log()
Avoids unnecessary default construction of an entry in cases where no
entry exists before overwriting the created entry.
2021-04-23 09:27:18 -04:00
Lioncash
5ba49f188b lm: Prevent redundant map lookups in Log()
We can perform the lookup and then do the contains check by checking the
end iterator. The benefit of this is that if we *do* find an entry, then
we aren't hashing into the map again to find it.

We can also get rid of an unused std::vector temporary while we're at
it.
2021-04-23 09:24:21 -04:00
Lioncash
6e2040c955 lm: Resolve -Wextra-semi warning
Resolves a trivial warning with clang.
2021-04-23 09:20:54 -04:00
Chloe Marcec
9d5a56a40b lm: Fix ReadLeb128
Fixes assertion on Bloodstained Ritual of the Night.

We would over read sometimes, this is fixed by checking if the top bit is set in the first iteration. We also lock the loop off to be only the max size of the type we can fit. Finally we changed an incorrect print of "DEBUG" to "TRACE" to reflect the proper log severity
2021-02-07 23:52:56 +11:00
Chloe Marcec
2afc1060ef Print Process ID and Thread ID as hex 2021-01-25 02:47:40 +11:00
Chloe Marcec
df42100320 Clamp string reads to buffer size 2021-01-23 18:24:57 +11:00
Chloe Marcec
dc18a1261c Mark DestinationToString as static 2021-01-20 18:42:39 +11:00
Chloe Marcec
dca2e2c8f1 Mark LogPacketHeaderEntry hash as noexcept 2021-01-20 18:35:58 +11:00
Chloe Marcec
83f8c1a25e lm: Recode LM service
Rework the service to spit out to logs instead of a seperate file as well as fix any crashes caused by lm.
2021-01-20 18:25:15 +11:00
Lioncash
6b7320add4 core: Remove unnecessary enum casts in log calls
Follows the video core PR. fmt doesn't require casts for enum classes
anymore, so we can remove quite a few casts.
2020-12-07 23:02:23 -05:00
Lioncash
1a954b2a59 service: Eliminate usages of the global system instance
Completely removes all usages of the global system instance within the
services code by passing in the using system instance to the services.
2020-11-26 20:03:11 -05:00
Lioncash
da7be67daf ipc_helpers: Remove usage of the global system instance
Resolves numerous deprecation warnings throughout the codebase due to
inclusion of this header. Now building core should be significantly less
noisy (and also relying on less global state).

This also uncovered quite a few modules that were relying on indirect
includes, which have also been fixed.
2020-11-08 15:58:11 -05:00
Morph
45dac6bc5c lm: Silence no return value warning 2020-06-22 22:55:32 -04:00
bunnei
4caff51710 core: memory: Move to Core::Memory namespace.
- helpful to disambiguate Kernel::Memory namespace.
2020-04-17 00:59:28 -04:00
Lioncash
b05bfc6036 core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory class
With all of the trivial parts of the memory interface moved over, we can
get right into moving over the bits that are used.

Note that this does require the use of GetInstance from the global
system instance to be used within hle_ipc.cpp and the gdbstub. This is
fine for the time being, as they both already rely on the global system
instance in other functions. These will be removed in a change directed
at both of these respectively.

For now, it's sufficient, as it still accomplishes the goal of
de-globalizing the memory code.
2019-11-26 21:55:39 -05:00
Lioncash
536fc7f0ea core: Prepare various classes for memory read/write migration
Amends a few interfaces to be able to handle the migration over to the
new Memory class by passing the class by reference as a function
parameter where necessary.

Notably, within the filesystem services, this eliminates two ReadBlock()
calls by using the helper functions of HLERequestContext to do that for
us.
2019-11-26 21:55:37 -05:00
Zach Hilman
6212df3beb lm: Flush manager output on core shutdown 2019-09-22 12:34:55 -04:00
Zach Hilman
fa6531ab0f lm: Rename Initialize to Log and implement with manager/reporter
Allows saving and clearer output of data.
2019-09-22 12:34:55 -04:00
Zach Hilman
ef9a7fa1f5 lm: Implement manager class to output to reporter 2019-09-22 12:34:55 -04:00
Zach Hilman
4153bd8d17 core: Add LM::Manager to system
Allows centralized control over logging mechanisms.
2019-09-22 12:34:55 -04:00
Weiyi Wang
89abef3518 remove all occurance of specifying endianness inside BitField
This commit it automatically generated by command in zsh:
sed -i -- 's/BitField<\(.*\)_le>/BitField<\1>/g' **/*(D.)

BitField is now aware to endianness and default to little endian. It expects a value representation type without storage specification for its template parameter.
2019-02-06 18:13:45 +01:00
David Marcec
a2cc3b10bb Changed logging to be "Log before execution", Added more error logging, all services should now log on some level 2018-11-26 17:06:13 +11:00
Lioncash
34e4aaddd9 lm: Implement SetDestination by doing nothing
This service function was likely intended to be a way to redirect where
the output of a log went. e.g. Firing a log over a network, dumping over
a tunneling session, etc.

Given we always want to see the log and not change its output. It's one
of the lucky service functions where the easiest implementation is to
just do nothing at all and return success.
2018-11-19 18:09:40 -05:00
fearlessTobi
63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
Lioncash
b74df62959 lm: Use LOG_DEBUG for printing out trace logs
Using LOG_TRACE here isn't a good idea because LOG_TRACE is only enabled
when yuzu is compiled in debug mode. Debug mode is also quite slow, and
so we're potentially throwing away logging messages that can provide
value when trying to boot games.
2018-08-15 01:07:41 -04:00
Lioncash
e0b0f4eece lm: Handle threads and modules within the logger
The thread field serves to indicate which thread a log is related to and
provides the length of the thread's name, so we can print that out,
ditto for modules.

Now we can know what threads are potentially spawning off logging
messages (for example Lydie & Suelle bounces between MainThread and
LoadingThread when initializing the game).
2018-08-15 01:05:50 -04:00
Lioncash
f77cfab516 lm: Amend name of ILogger
Previously this was being registered with the name "Logger". While we're
at it, also change the name of the class to match it.
2018-08-01 17:08:44 -04:00
Lioncash
91d86df920 lm: Move LM's class declaration into the cpp file
This isn't used directly outside of this translation unit, so we can
hide it from external use.
2018-07-25 22:40:16 -04:00
Lioncash
6f4d3d8163 lm: Amend names of Initialize() in Logger and Initialize() in LM
Amends these to match the information on Switch Brew.
2018-07-25 22:39:39 -04:00
Lioncash
8650be1020 lm: Add missing function entry to Logger's function table 2018-07-25 22:26:32 -04:00
James Rowe
638956aa81 Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
Lioncash
dabfd90dfe
lm: Move logging macros over to new fmt-compatible ones 2018-04-24 12:00:56 -04:00
Lioncash
ccca5e7c28 service: Use nested namespace specifiers where applicable
Tidies up namespace declarations
2018-04-19 22:20:28 -04:00
mailwl
55de13efcc Service/lm: add support to multiline logs 2018-02-13 09:44:53 +03:00
bunnei
649960b4eb logger: Add LM service logging category. 2018-02-04 22:41:55 -05:00
bunnei
69697535bf lm: Ensure log string is non-empty before checking back(). 2018-02-04 22:36:57 -05:00
bunnei
1b1d399e5f hle: Rename RequestBuilder to ResponseBuilder. 2018-01-24 22:24:10 -05:00
bunnei
f9dae99006 service: Fix all incorrect IPC response headers. 2018-01-24 22:21:33 -05:00
Subv
b0489c9a64 Services: Added a todo about returning interfaces as domain objects in lm, hid and time. 2018-01-22 20:40:43 -05:00
Subv
1a9c96e4de LM: Don't create an unnecessary port in Initialize. 2018-01-22 17:35:40 -05:00
bunnei
22465c8722 lm: Minor logging fix to skip a byte. 2018-01-18 00:08:38 -05:00
bunnei
71eeab257f lm: Fix IPC header for Initialize. 2018-01-14 21:45:06 -05:00
bunnei
1247c53786 yuzu: Update license text to be consistent across project. 2018-01-13 16:22:39 -05:00
Subv
188feba457 Services: Allow lm to log single-character messages. 2018-01-10 00:41:29 -05:00
Subv
0368324f79 IPC Cleanup: Remove 3DS-specific code and translate copy, move and domain objects in IPC requests.
Popping objects from the buffer is still not implemented.
2018-01-07 17:11:47 -05:00
bunnei
6f6d9af408 lm: Assert on unsupported multi-message. 2018-01-06 14:41:56 -05:00