Namespaces
Enumerations
enum Error
| Name | Value |
|---|---|
| kNotSet | 0 |
| kDefault | 1 |
| kLogicError | 2 |
| kTimeout | 3 |
| kConnectionError | 4 |
| kAsyncTaskPostFailure | 5 |
| kMissingValue | 6 |
| kBadValue | 7 |
| kInvalidFormat | 8 |
| kFileReadFailure | 9 |
| kFileWriteFailure | 10 |
| kNotAvailableInProduct | 11 |
| kCustom | 12 |
Defines common errors that occur throughout //src/developer/feedback.
Defined at line 19 of file ../../src/developer/forensics/utils/errors.h
Records
-
class ArchiveFileStats -
class AsyncEventHandlerOpen -
class ErrorOrString -
class HasValueMatcher -
class IdentityRedactor -
class InspectNodeManager -
class InstrumentedBindingSet -
class MatchesAnnotationMatcherP2 -
class MatchesAttachmentMatcherP2 -
class MatchesKeyMatcherP -
class MatchesStringBufferMatcherP -
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
-
Replacer ReplaceWithText (std::string_view pattern, std::string_view replacement)Constructs a Replacer that substitutes all instances of |pattern| with |replacement|.
Defined at line 23 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
-
template <typename Value>fpromise::promise<Value, Error> MakePromiseTimeout (fpromise::promise<Value, Error> promise, async_dispatcher_t * dispatcher, const zx::duration timeout)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
-
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
-
template <typename Interface, auto Method, typename... Args>auto OneShotCall (async_dispatcher_t * dispatcher, const std::shared_ptr<sys::ServiceDirectory> & services, const zx::duration timeout, Args &&... args)Creates a single connection to |Interface| and calls |Method| on it with |args|. The result is
returned in a promise that completes with the returned values in the event of success or the
appropriate error code in the event of an error. The returned promise will have at type of
fpromise::promise
<ReturnT
, Error> or fpromise::promise
<std
::tuple
<ReturnTs
...>, Error>
dependent on the number of values returned.
Defined at line 68 of file ../../src/developer/forensics/utils/fidl_oneshot.h
-
std::string ToString (Error error)Provide a string representation of |error|.
Defined at line 82 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
-
Replacer ReplaceWithIdFormatString (std::string_view pattern, std::string_view format, 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 134 of file ../../src/developer/forensics/utils/redact/replacer.cc
-
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
-
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 175 of file ../../src/developer/forensics/testing/gmatchers.h
-
testing::Matcher<feedback::AttachmentValue> AttachmentValueIs (std::string data, const Error error)Defined at line 179 of file ../../src/developer/forensics/testing/gmatchers.h
-
Replacer ReplaceIPv4 ()Constructs a Replacer that substitutes all instances IPv4 address with "<REDACTED-IPV4: %d>"
Defined at line 189 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 210 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 268 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 290 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 347 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 367 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 384 of file ../../src/developer/forensics/utils/redact/replacer.cc