KiCad PCB EDA Suite
Loading...
Searching...
No Matches
trace_capture.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef QA_DRC_BENCHMARK_TRACE_CAPTURE_H
21#define QA_DRC_BENCHMARK_TRACE_CAPTURE_H
22
23#include <map>
24
25#include <wx/log.h>
26#include <wx/string.h>
27
28
40class DRC_PROFILE_LOG : public wxLog
41{
42public:
44 ~DRC_PROFILE_LOG() override = default;
45
46 void Clear();
47
48 const std::map<wxString, double>& ProviderMs() const { return m_providerMs; }
49 double TotalMs() const { return m_totalMs; }
50
55 bool ParseLine( const wxString& aMsg );
56
57protected:
58 void DoLogTextAtLevel( wxLogLevel aLevel, const wxString& aMsg ) override;
59
60private:
61 std::map<wxString, double> m_providerMs;
62 double m_totalMs = 0.0;
63 wxLog* m_prev = nullptr;
64};
65
66
73
74#endif // QA_DRC_BENCHMARK_TRACE_CAPTURE_H
const std::map< wxString, double > & ProviderMs() const
void DoLogTextAtLevel(wxLogLevel aLevel, const wxString &aMsg) override
double TotalMs() const
bool ParseLine(const wxString &aMsg)
Parse a single trace message into the maps.
~DRC_PROFILE_LOG() override=default
std::map< wxString, double > m_providerMs
int RunTraceCaptureSelftest()
Run the three fixed self-test lines through a fresh parser and confirm the parsed provider map and to...