Namespaces
Enumerations
enum class Error
| Name | Value | Comments |
|---|---|---|
| kNotSet | 0 | -- |
| kDefault | 1 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kLogicError | 2 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kTimeout | 3 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kConnectionError | 4 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kAsyncTaskPostFailure | 5 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kMissingValue | 6 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kBadValue | 7 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kInvalidFormat | 8 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kFileReadFailure | 9 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kFileWriteFailure | 10 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kNotAvailableInProduct | 11 |
TODO(https://fxbug.dev/42126944): Remove kDefault. This value is temporary to allow the enum to |
| kCustom | 12 |
Custom errors code that can be interpreted in different ways by different components. |
Defines common errors that occur throughout //src/developer/feedback.
Defined at line 20 of file ../../src/developer/forensics/utils/errors.h
Records
-
class ArchiveFileStats -
class AsyncEventHandlerClosed -
class AsyncEventHandlerOpen -
class ErrorOrString -
class HasValueMatcher -
class IdentityRedactor -
class InspectNodeManager -
class InstrumentedBindingSet -
class InstrumentedBindingSet<Protocol> -
class MatchesAnnotationMatcherP2 -
class MatchesAttachmentMatcherP2 -
class MatchesKeyMatcherP -
class MatchesStringBufferMatcherP -
class MonotonicBackoff -
class PreviousBootFile -
class RedactionIdCache -
class Redactor -
class RedactorBase -
class SizedData -
class StorageSize -
class UnitTestFixture -
class UtcClockReadyWatcher -
class UtcClockReadyWatcherBase -
class UtcTimeProvider
Functions
-
re2::LazyRE2 MakeLazyRE2 (const char *const str)Defined at line 12 of file ../../src/developer/forensics/utils/regexp.h
-
void PurgeAllMemoryAfter (async_dispatcher_t * dispatcher, zx::duration delay)Purges unused memory using M_PURGE_ALL.
Defined at line 16 of file ../../src/developer/forensics/utils/purge_memory.cc
-
std::string Format (const fuchsia::logger::LogMessage & message)Format a log message as a string. Inserts a "dropped log" message if |message.dropped_logs| > 0.
Defined at line 55 of file ../../src/developer/forensics/utils/log_format.cc
-
std::optional<std::string> FormatDuration (zx::duration duration)Formats the provided duration as WdXhYmZs e.g., 1d14h7m32s
Defined at line 18 of file ../../src/developer/forensics/utils/time.cc
-
zx::result<std::string> StringFromVmo (const zx::unowned_vmo & vmo)Reads the contents of |vmo| as a string.
The size of the returned string is determined by the stream size of |vmo|.
Returns a string on success, or a zx_status_t error if retrieving the stream size or
reading fails.
Defined at line 11 of file ../../src/developer/forensics/utils/vmo.cc
-
Replacer ReplaceWithText (std::string_view pattern, std::string_view replacement)Constructs a Replacer that substitutes all instances of |pattern| with |replacement|.
Defined at line 24 of file ../../src/developer/forensics/utils/redact/replacer.cc
-
std::optional<std::string> FormatSecondsSinceEpoch (std::string_view seconds)Formats the provided seconds since unix epoch as a date like, YYYY-MM-DDTHH:MM:SS+00:00
Defined at line 41 of file ../../src/developer/forensics/utils/time.cc
-
zx::result<std::string> StringFromVmo (const zx::vmo & vmo)Defined at line 31 of file ../../src/developer/forensics/utils/vmo.cc
-
timekeeper::time_utc CurrentUtcTimeRaw (timekeeper::Clock * clock)Returns the non-localized current time according to |clock|.
Defined at line 54 of file ../../src/developer/forensics/utils/time.cc
-
std::string CurrentUtcTime (timekeeper::Clock * clock)Returns a non-localized human-readable timestamp of the current time according to |clock|.
Defined at line 66 of file ../../src/developer/forensics/utils/time.cc
-
zx::result<zx::vmo> VmoFromString (std::string_view string)Creates a new VMO containing |string|.
The stream size of the returned VMO is set to |string.size()|.
Returns the VMO on success, or a zx_status_t error if creating or writing to the VMO fails.
Defined at line 33 of file ../../src/developer/forensics/utils/vmo.cc
-
Error FidlErrorToForensicsError (const ::fidl::Error & error)Defined at line 11 of file ../../src/developer/forensics/utils/errors.cc
-
template <typename Value>fpromise::promise<Value, Error> MakePromiseTimeout (fpromise::promise<Value, Error>promise,async_dispatcher_t *dispatcher,const zx::durationtimeout)Returns Error::kTimeout if |promise| does not complete within |timeout|.
Defined at line 60 of file ../../src/developer/forensics/utils/promise_timeout.h
-
void PrintTo (const Error error, std::ostream * os)Defined at line 63 of file ../../src/developer/forensics/testing/gpretty_printers.h
-
void PrintTo (const ErrorOrString & error_or, std::ostream * os)Defined at line 65 of file ../../src/developer/forensics/testing/gpretty_printers.h
-
bool Archive (const std::map<std::string, std::string> &files,fsl::SizedVmo *archive,std::map<std::string, ArchiveFileStats> *file_to_size_stats)Bundles a map of filenames to string content into a single ZIP archive with DEFLATE compression.
Also returns a map of the same filenames to size stats.
Defined at line 65 of file ../../src/developer/forensics/utils/archive.cc
-
std::string ToString (Error error)Provide a string representation of |error|.
Defined at line 85 of file ../../src/developer/forensics/utils/errors.h
-
template <typename T>StorageSize operator* (const T scalar, StorageSize size)Defined at line 98 of file ../../src/developer/forensics/utils/storage_size.h
-
template <>MatchesKeyMatcherP<expected_key_type> MatchesKey (expected_key_type gmock_p0)Returns true if gMock |arg|.key matches |expected_key|.
Defined at line 137 of file ../../src/developer/forensics/testing/gmatchers.h
-
Replacer ReplaceWithIdFormatString (std::string_viewpattern,std::string_viewformat,const std::vector<std::string> &ignore_prefixes)Constructs a Replacer that substitutes all instances of |pattern| with |format| and the id for
the matched pattern. However, text will not be replaced if any strings from |ignore_prefixes|
occur just _before_ the matching pattern begins, regardless of whether the found prefix starts on
a word boundary. See examples 1 and 2.
If a match happens to start with a string X from |ignore_prefixes|, the match will still be
redacted unless that matching text also has an instance of X _before_ the matching text begins.
See examples 3 and 4.
Some examples:
1)
pattern: "id:a+"
ignore_prefix: "elf:"
replace: "<REDACTED>"
content: "other_stuff:id:aaa"
result: "other_stuff:<REDACTED>"
2)
pattern: "id:a+"
ignore_prefix: "elf:"
replace: "<REDACTED>"
content: "elf:id:aaa"
result: "elf:id:aaa"
3)
pattern: "elf:a+"
ignore_prefix: "elf:"
replace: "<REDACTED>"
content: "other_stuff:elf:aaa"
result: "other_stuff:<REDACTED>"
4)
pattern: "elf:a+"
ignore_prefix: "elf:"
replace: "<REDACTED>"
content: "elf:elf:aaa"
result: "elf:elf:aaa"
Note: |pattern| must extract at least 1 value.
Note: |format| must contain exactly 1 integer format specifier, i.e. '%d'.
Defined at line 139 of file ../../src/developer/forensics/utils/redact/replacer.cc
-
template <,>MatchesAttachmentMatcherP2<expected_key_type, expected_value_type> MatchesAttachment (expected_key_type gmock_p0, expected_value_type gmock_p1)Returns true if gMock |arg|.key matches |expected_key| and str(|arg|.value) matches
|expected_value|, assuming two Attachment objects.
Defined at line 144 of file ../../src/developer/forensics/testing/gmatchers.h
-
template <,>MatchesAnnotationMatcherP2<expected_key_type, expected_value_type> MatchesAnnotation (expected_key_type gmock_p0, expected_value_type gmock_p1)Returns true if gMock |arg|.key matches |expected_key| and str(|arg|.value) matches
|expected_value|, assuming two Annotation objects.
Defined at line 152 of file ../../src/developer/forensics/testing/gmatchers.h
-
template <>MatchesStringBufferMatcherP<expected_type> MatchesStringBuffer (expected_type gmock_p0)Returns true if gMock str(|arg|) matches |expected|.
Defined at line 159 of file ../../src/developer/forensics/testing/gmatchers.h
-
HasValueMatcher HasValue ()Defined at line 163 of file ../../src/developer/forensics/testing/gmatchers.h
-
bool Unpack (const fuchsia::mem::Buffer & archive, std::map<std::string, std::string> * files)Unpack a ZIP archive into a map of filenames to string content.
Defined at line 168 of file ../../src/developer/forensics/utils/archive.cc
-
testing::Matcher<feedback::AttachmentValue> AttachmentValueIs (std::string data)Defined at line 171 of file ../../src/developer/forensics/testing/gmatchers.h
-
testing::Matcher<feedback::AttachmentValue> AttachmentValueIs (const Error error)Defined at line 176 of file ../../src/developer/forensics/testing/gmatchers.h
-
testing::Matcher<feedback::AttachmentValue> AttachmentValueIs (std::string data, const Error error)Defined at line 181 of file ../../src/developer/forensics/testing/gmatchers.h
-
testing::Matcher<feedback::AttachmentData> AttachmentDataIs (std::string data)Defined at line 188 of file ../../src/developer/forensics/testing/gmatchers.h
-
testing::Matcher<feedback::AttachmentData> AttachmentDataIs (const Error error)Defined at line 193 of file ../../src/developer/forensics/testing/gmatchers.h
-
testing::Matcher<feedback::AttachmentData> AttachmentDataIs (std::string data, const Error error)Defined at line 198 of file ../../src/developer/forensics/testing/gmatchers.h
-
Replacer ReplaceSensitive ()Constructs a Replacer that substitutes all instances of SENSITIVE{...} decorators with
"<REDACTED-SENSITIVE>".
Defined at line 221 of file ../../src/developer/forensics/utils/redact/replacer.cc
-
Replacer ReplaceIPv4 ()Constructs a Replacer that substitutes all instances IPv4 address with "<REDACTED-IPV4: %d>"
Defined at line 260 of file ../../src/developer/forensics/utils/redact/replacer.cc
-
Replacer ReplaceFidlIPv4 ()Constructs a Replacer that substitutes all instances of IPv4 addresses from FIDL debug output
with "<REDACTED-IPV4: %d>"
Defined at line 281 of file ../../src/developer/forensics/utils/redact/replacer.cc
-
Replacer ReplaceIPv6 ()Constructs a Replacer that substitutes all instances IPv6 address with some variation of
"<REDACTED-IPV6: %d>"
Defined at line 339 of file ../../src/developer/forensics/utils/redact/replacer.cc
-
Replacer ReplaceFidlIPv6 ()Constructs a Replacer that substitutes all instances of IPv6 addresses from FIDL debug output
with "<REDACTED-IPV6: %d>"
Defined at line 361 of file ../../src/developer/forensics/utils/redact/replacer.cc
-
Replacer ReplaceMac ()Constructs a Replacer that substitutes all instances of MAC address with a string like
"<REDACTED-MAC: %d>"
Defined at line 418 of file ../../src/developer/forensics/utils/redact/replacer.cc
-
Replacer ReplaceFidlMac ()Constructs a Replacer that substitutes all instances of MAC addresses from FIDL debug output
with "<REDACTED-MAC: %d>"
Defined at line 438 of file ../../src/developer/forensics/utils/redact/replacer.cc
-
Replacer ReplaceSsid ()Constructs a Replacer that substitutes all instances of SSIDs with a string like
"<REDACTED-SSID: %d>"
Defined at line 455 of file ../../src/developer/forensics/utils/redact/replacer.cc