1/* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto2"; 18 19import "protos/perfetto/config/trace_config.proto"; 20 21package perfetto.protos; 22 23// This is the schema for the config files in /test/stress_test/configs/*.cfg. 24message StressTestConfig { 25 optional TraceConfig trace_config = 1; 26 27 // Shared Memory Buffer setup, passed as arguments to Tracing.Initialize(). 28 optional uint32 shmem_size_kb = 2; 29 optional uint32 shmem_page_size_kb = 3; 30 31 // How many producer processes to spawn. 32 optional uint32 num_processes = 4; 33 34 // How many writer threads each producer process should spawn. 35 optional uint32 num_threads = 5; 36 37 // The producer will write events until one of the following is met: 38 // - trace_config.duration_ms is reached. 39 // - max_events is reached. 40 optional uint32 max_events = 6; 41 42 // If > 0 will write nested messages up to N levels deep. The size of each 43 // nested message depends on the payload_mean / sttdev arguments (below). 44 // This is to cover the patching logic. 45 optional uint32 nesting = 7; 46 47 // This submessage defines the timings of each writer worker thread. 48 message WriterTiming { 49 // The size of the payload written on each iteration. 50 optional double payload_mean = 1; 51 optional double payload_stddev = 2; 52 53 // The nominal event writing rate, expressed in events/sec. 54 // E.g. if payload_mean = 500 (bytes) and rate_mean = 1000 (Hz), each thread 55 // will write 500 KB / sec approximately (% stalling). 56 optional double rate_mean = 3; 57 optional double rate_stddev = 4; 58 59 // If non-zero each worker will slow down the writing of the payload: 60 // it writes half payload, sleep for payload_write_time_ms, then write the 61 // other half. 62 optional uint32 payload_write_time_ms = 5; 63 } 64 65 // The timings used by default. 66 optional WriterTiming steady_state_timings = 8; 67 68 // Optionally it is possible to cause a writer to enter "burst mode", 69 // simulating peaks of high-intensity writing. The way it works is the 70 // following: by default the writer writes events using the 71 // |steady_state_timings|. Then every |burst_period_ms| it will switch to the 72 // |burst_timings| for |burst_duration_ms|, and go back to the steady state 73 // after that (and then repeat). 74 optional uint32 burst_period_ms = 9; 75 optional uint32 burst_duration_ms = 10; 76 optional WriterTiming burst_timings = 11; 77} 78