Records

Functions

  • void InitComponentContext ()

    Call this once from main().

    Defined at line 18 of file ../../src/performance/trace/tests/component_context.cc

  • template <typename T>
    fit::result<fuchsia_tracing_controller::StartError> TryStart (TraceManagerTest * fixture, const T & interface_ptr)

    This only works when no other condition could cause the loop to exit.

    E.g., This doesn't work if the state is kStopping or kTerminating as the

    transition to kStopped,kTerminated will also cause the loop to exit.

    Defined at line 18 of file ../../src/performance/trace_manager/tests/start_tests.cc

  • sys::ComponentContext * GetComponentContext ()

    Call this to get the component context pointer.

    N.B. Use of this value requires the presence of the default async-loop dispatcher.

    This constraint is imposed on us by the use of

    |sys::ComponentContext::CreateAndServeOutgoingDirectory()|.

    Defined at line 27 of file ../../src/performance/trace/tests/component_context.cc

  • bool StartSelfContainedProvider (thrd_t * out_thread)

    Defined at line 42 of file ../../src/performance/trace/tests/self_contained_provider.cc

  • void AppendLoggingArgs (std::vector<std::string> * argv, const char * prefix, const fxl::LogSettings & log_settings)

    Append the current state of fxl::logging to |argv|.

    |prefix| is prepended to each argument.

    For example, if |prefix| is "--foo=" and verbosity is 2, then

    "--foo=--verbose=2" will be appended to |argv|.

    Defined at line 22 of file ../../src/performance/lib/test_utils/run_program.cc

  • zx_status_t SpawnProgram (const zx::job & job, const std::vector<std::string> & argv, zx_handle_t arg_handle, zx::process * out_process)

    Wrapper around |fdio_spawn_etc()|.

    If |arg_handle| is not ZX_HANDLE_INVALID, then it is passed to the

    process with id PA_USER0.

    Defined at line 46 of file ../../src/performance/lib/test_utils/run_program.cc

  • template <typename T>
    void TryExtraStart (TraceManagerTest * fixture, const T & interface_ptr)

    Defined at line 47 of file ../../src/performance/trace_manager/tests/start_tests.cc

  • bool RunTrace (const zx::job & job, const std::vector<std::string> & args, zx::process * out_child)

    Run the trace program, but do not wait for it to exit.

    |args| is the list of arguments to pass. It is not called |argv| as it does not include argv[0].

    Wait for trace to exit with |WaitAndGetReturnCode()|.

    The only current reason to use this instead of |RunTraceAndWait()| is when one is expecting a

    non-zero return code from trace.

    Defined at line 104 of file ../../src/performance/trace/tests/run_test.cc

  • zx_status_t RunProgram (const zx::job & job, const std::vector<std::string> & argv, size_t num_actions, const fdio_spawn_action_t * actions, zx::process * out_process)

    Wrapper around |fdio_spawn_etc()|.

    Defined at line 61 of file ../../src/performance/lib/test_utils/run_program.cc

  • bool RunTraceAndWait (const zx::job & job, const std::vector<std::string> & args)

    Run the trace program and wait for it to exit.

    Returns true if trace ran successfully and exited with a zero return code.

    |args| is the list of arguments to pass. It is not called |argv| as it does not include argv[0].

    Defined at line 130 of file ../../src/performance/trace/tests/run_test.cc

  • bool WaitAndGetReturnCode (const std::string & program_name, const zx::process & process, int64_t * out_return_code)

    Wait for |process| to exit.

    |program_name| is for logging purposes.

    Defined at line 80 of file ../../src/performance/lib/test_utils/run_program.cc

  • bool RunProgramAndWait (const zx::job & job, const std::vector<std::string> & argv, size_t num_actions, const fdio_spawn_action_t * actions)

    Wrapper on |RunProgram(),WaitAndGetReturnCode()|.

    The program must exit with a zero return code for success.

    Defined at line 105 of file ../../src/performance/lib/test_utils/run_program.cc

  • bool RunIntegrationTest (const std::string & app_path, const std::string & test_name, const std::string & categories, size_t buffer_size_in_mb, const std::string & buffering_mode, std::initializer_list<std::string> additional_arguments, const std::string & relative_output_file_path)

    Runs and traces integration test system app with run command and given parameters. This looks up

    the test by name and produces a trace file that can be verified using VerifyIntegrationTest.

    additional_arguments are passed to trace, not to the test app.

    Defined at line 149 of file ../../src/performance/trace/tests/run_test.cc

  • bool VerifyIntegrationTest (const std::string & app_path, const std::string & test_name, size_t buffer_size_in_mb, const std::string & buffering_mode, const std::string & relative_output_file_path)

    Runs integration test system app with verify command and given parameters. This verifies the

    trace file resulting from a call to RunIntegrationTest using the test's verification method.

    Defined at line 169 of file ../../src/performance/trace/tests/run_test.cc

  • const IntegrationTest * LookupTest (const std::string & test_name)

    Given |test_name| return its |IntegrationTest| spec.

    Defined at line 74 of file ../../src/performance/trace/tests/two_providers_two_engines.cc

  • template <typename T>
    void TryExtraStop (TraceManagerTest * fixture, const T & interface_ptr)

    Defined at line 78 of file ../../src/performance/trace_manager/tests/stop_tests.cc

  • bool CreateProviderSynchronously (async::Loop & loop, const char * name, std::unique_ptr<trace::TraceProvider> * out_provider, bool * out_already_started)

    Create a provider.

    On success an indicator of whether tracing has already started is stored in

    |*out_already_started|. This does not mean tracing has started in this provider; this provider

    must still wait for the Start() request from trace-manager.

    This is intended to be accompanied by a call to |WaitForTracingToStart()|.

    The two are split out as the details of waiting depend on the loop being used (e.g., is it

    running in a foreground thread or background thread?).

    Defined at line 119 of file ../../src/performance/trace/tests/integration_test_utils.cc

  • bool CreateProviderSynchronouslyAndWait (async::Loop & loop, const char * name, std::unique_ptr<trace::TraceProvider> * out_provider)

    Simplified version that calls both |CreateProviderSynchronously(),WaitForTracingToStart()|.

    Defined at line 137 of file ../../src/performance/trace/tests/integration_test_utils.cc

  • void WriteTestEvents (size_t num_records)

    Emit |num_iterations| records that |VerifyTestEvents()| knows how to test.

    Defined at line 165 of file ../../src/performance/trace/tests/integration_test_utils.cc

  • bool IsWriteTestEvent (const trace::Record & record)

    Return true if |record| was emitted by |WriteTestEvents()|.

    Defined at line 172 of file ../../src/performance/trace/tests/integration_test_utils.cc

  • bool VerifyTestEventsFromJson (const std::string & test_output_file, size_t * out_num_events)

    Verify a trace generated with |WriteTestEvents()| in json format.

    Returns a boolean indicating success.

    On success returns the number of events found in |*out_num_events|.

    Defined at line 184 of file ../../src/performance/trace/tests/integration_test_utils.cc

  • std::ostream & operator<< (std::ostream & out, FakeProvider::State state)

    Defined at line 371 of file ../../src/performance/trace_manager/tests/fake_provider.cc

  • bool VerifyTestEventsFromFxt (const std::string & test_output_file, trace::TraceReader::RecordConsumer record_consumer)

    Verify a trace generated with |WriteTestEvents()| in binary fxt format.

    Returns a boolean indicating success.

    Defined at line 256 of file ../../src/performance/trace/tests/integration_test_utils.cc

  • void FillBuffer (size_t num_times, size_t buffer_size_in_mb)

    Write as many records as we can to ensure a buffer of size

    |buffer_size_in_mb| is full, and fill it |num_times|.

    Defined at line 280 of file ../../src/performance/trace/tests/integration_test_utils.cc

  • bool VerifyFullBuffer (const std::string & test_output_file, tracing::BufferingMode buffering_mode, size_t buffer_size_in_mb)

    Verify the trace generated by |FillBuffer()|.

    Returns a boolean indicating success.

    Defined at line 334 of file ../../src/performance/trace/tests/integration_test_utils.cc

  • bool WaitForTracingToStart (async::Loop & loopzx::duration timeout)

    Wait for tracing to start or |timeout|.

    Basically this means waiting for the Start() request which contains the trace buffer (as a vmo)

    and other things.

    |loop| must be idle and not have any background threads.

    Returns true on success.

    Defined at line 351 of file ../../src/performance/trace/tests/integration_test_utils.cc

Variables

const IntegrationTest *[3] kIntegrationTests

Defined at line 12 of file ../../src/performance/trace/tests/basic_integration_tests.cc

const IntegrationTest kSimpleIntegrationTest

Defined at line 57 of file ../../src/performance/trace/tests/simple_integration_test.cc

const IntegrationTest kFillBufferIntegrationTest

Defined at line 73 of file ../../src/performance/trace/tests/fill_buffer_integration_test.cc

const IntegrationTest kFillBufferAndAlertIntegrationTest

Defined at line 87 of file ../../src/performance/trace/tests/fill_buffer_and_alert_integration_test.cc