1 /* 2 * Copyright (C) 2018 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 17 #include "src/traced/probes/ftrace/ftrace_stats.h" 18 19 #include "protos/perfetto/trace/ftrace/ftrace_stats.pbzero.h" 20 21 namespace perfetto { 22 Write(protos::pbzero::FtraceStats * writer) const23void FtraceStats::Write(protos::pbzero::FtraceStats* writer) const { 24 for (const FtraceCpuStats& cpu_specific_stats : cpu_stats) { 25 cpu_specific_stats.Write(writer->add_cpu_stats()); 26 } 27 } 28 Write(protos::pbzero::FtraceCpuStats * writer) const29void FtraceCpuStats::Write(protos::pbzero::FtraceCpuStats* writer) const { 30 writer->set_cpu(cpu); 31 writer->set_entries(entries); 32 writer->set_overrun(overrun); 33 writer->set_commit_overrun(commit_overrun); 34 writer->set_bytes_read(bytes_read); 35 writer->set_oldest_event_ts(oldest_event_ts); 36 writer->set_now_ts(now_ts); 37 writer->set_dropped_events(dropped_events); 38 writer->set_read_events(read_events); 39 } 40 41 } // namespace perfetto 42