2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: BlackBox.hpp
|
|
|
|
Date: 2021-6-10
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Aurora::Telemetry
|
|
|
|
{
|
|
|
|
enum class ENewBlackBoxEntry
|
|
|
|
{
|
|
|
|
eSpecsMetadata,
|
|
|
|
eMessage,
|
|
|
|
eStackWarning,
|
|
|
|
eAccessViolation,
|
|
|
|
eAssertion,
|
|
|
|
ePanic,
|
|
|
|
eLog,
|
|
|
|
eScreenshot,
|
|
|
|
eMinidump,
|
|
|
|
eAnnounceMap,
|
|
|
|
eAnnounceThreadName,
|
|
|
|
eAnnounceApplication,
|
|
|
|
eAnnounceSymbols
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlockboxEntryMessage
|
|
|
|
{
|
|
|
|
AuUInt address;
|
|
|
|
AuUInt32 category;
|
|
|
|
AuString message;
|
|
|
|
AuUInt32 threadId;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlockBoxEntryStackReport
|
|
|
|
{
|
2022-01-27 05:24:08 +00:00
|
|
|
AuString str;
|
2021-06-27 21:25:29 +00:00
|
|
|
Debug::StackTrace backtrace;
|
2022-01-21 16:26:35 +00:00
|
|
|
AuUInt32 fenceId;
|
2021-06-27 21:25:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlackboxEntryUpdateMapEntry
|
|
|
|
{
|
|
|
|
AuUInt base;
|
|
|
|
AuUInt size;
|
|
|
|
char perms[6];
|
|
|
|
AuString module;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlackboxEntryUpdateMap
|
|
|
|
{
|
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
|
|
|
Aurora::Process::Sections map;
|
2021-06-27 21:25:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class ENewBlackBoxAccessViolation
|
|
|
|
{
|
|
|
|
eUnknown,
|
|
|
|
eNXViolation,
|
|
|
|
eWriteViolation,
|
|
|
|
eMissingPage
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlockBoxEntryMemoryViolation
|
|
|
|
{
|
|
|
|
AuUInt address;
|
|
|
|
AuUInt code;
|
|
|
|
ENewBlackBoxAccessViolation type;
|
|
|
|
NewBlockBoxEntryStackReport stack;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlockboxEntryBasicMessage
|
|
|
|
{
|
|
|
|
Console::ConsoleMessage message;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class ENewBlackBoxResourceType
|
|
|
|
{
|
|
|
|
eLocal,
|
|
|
|
eResource
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlackBoxResource
|
|
|
|
{
|
|
|
|
ENewBlackBoxResourceType type;
|
|
|
|
|
|
|
|
AuString path;
|
|
|
|
int resourceId;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlackBoxEntryScreenshot
|
|
|
|
{
|
|
|
|
NewBlackBoxResource resource;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class MinidumpType
|
|
|
|
{
|
|
|
|
eMSVC,
|
|
|
|
eBreakpadMSVC,
|
|
|
|
eBrokenElfRamDump,
|
|
|
|
eMagicalMinidump,
|
|
|
|
eExternalEcosystemTransaction
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlackBoxEntryMinidump
|
|
|
|
{
|
|
|
|
MinidumpType type;
|
|
|
|
bool includesRx;
|
|
|
|
Aurora::Build::EPlatform platform;
|
|
|
|
NewBlackBoxResource resource;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlockboxEntryReportSpecs
|
|
|
|
{
|
|
|
|
Aurora::Build::EPlatform platform;
|
|
|
|
Aurora::Build::ECompiler compiler;
|
|
|
|
Aurora::Build::EABI abi;
|
|
|
|
|
|
|
|
Aurora::HWInfo::CpuInfo cpuInfo;
|
2021-09-14 23:56:26 +00:00
|
|
|
Aurora::HWInfo::RamStat sysMem;
|
2022-01-21 16:26:35 +00:00
|
|
|
Aurora::HWInfo::RamStat ramMem;
|
|
|
|
Aurora::HWInfo::RamStat procCommitMem;
|
|
|
|
Aurora::HWInfo::RamStat procLowerMem;
|
2021-06-27 21:25:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlackBoxEntryReportApplication
|
|
|
|
{
|
|
|
|
AuUInt16 applicationServiceNumber;
|
|
|
|
AuString applicationExecutableName;
|
|
|
|
AuString applicationPath;
|
|
|
|
|
|
|
|
AuString locality;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlackBoxEntryMapThread
|
|
|
|
{
|
|
|
|
AuUInt64 id;
|
|
|
|
AuUInt64 name;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct NewBlockboxEntry
|
|
|
|
{
|
|
|
|
ENewBlackBoxEntry type;
|
|
|
|
NewBlackBoxEntryReportApplication process;
|
|
|
|
NewBlockboxEntryReportSpecs specs;
|
|
|
|
NewBlockboxEntryMessage message;
|
|
|
|
NewBlockboxEntryMessage assertion;
|
|
|
|
NewBlockBoxEntryStackReport stack;
|
|
|
|
NewBlockboxEntryBasicMessage log;
|
|
|
|
NewBlockboxEntryBasicMessage panic;
|
|
|
|
NewBlockBoxEntryMemoryViolation violation;
|
|
|
|
NewBlackBoxEntryMinidump minidump;
|
|
|
|
NewBlackboxEntryUpdateMap map;
|
|
|
|
};
|
|
|
|
|
2022-01-19 18:18:13 +00:00
|
|
|
// TODO: port to lui
|
|
|
|
using StreamWriter = AuFunction<void(AuUInt8 stream, const AuUInt8 *buffer, AuUInt32 length)>;
|
|
|
|
using StreamReader = AuFunction<void(AuUInt8 stream, AuUInt8 *buffer, AuUInt32 &length)>;
|
2021-06-27 21:25:29 +00:00
|
|
|
|
|
|
|
AUKN_SYM AuList<NewBlockboxEntry> ReadBlackboxStream(const StreamReader &reader);
|
|
|
|
AUKN_SYM void WriteBlackboxStream(const AuList<NewBlockboxEntry> &, StreamWriter writer);
|
|
|
|
}
|