-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds support for the topdown metrics (fe-bound, be-bound etc.) as seen in perf
- Loading branch information
Showing
12 changed files
with
382 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* This file is part of the lo2s software. | ||
* Linux OTF2 sampling | ||
* | ||
* Copyright (c) 2021, | ||
* Technische Universitaet Dresden, Germany | ||
* | ||
* lo2s is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* lo2s is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with lo2s. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <lo2s/execution_scope.hpp> | ||
#include <lo2s/perf/counter/counter_collection.hpp> | ||
#include <lo2s/trace/trace.hpp> | ||
|
||
#include <cstdint> | ||
|
||
#include <vector> | ||
|
||
#include <cstdlib> | ||
namespace lo2s | ||
{ | ||
namespace perf | ||
{ | ||
namespace counter | ||
{ | ||
namespace topdown | ||
{ | ||
struct TopdownEvent | ||
{ | ||
uint64_t nr; | ||
uint64_t slots; | ||
uint64_t retiring; | ||
uint64_t bad_spec; | ||
uint64_t fe_bound; | ||
uint64_t be_bound; | ||
}; | ||
|
||
template <class T> | ||
class Reader | ||
{ | ||
public: | ||
Reader(ExecutionScope scope); | ||
|
||
void read(); | ||
|
||
int fd() | ||
{ | ||
return timer_fd_; | ||
} | ||
|
||
protected: | ||
int leader_fd_; | ||
std::vector<int> counter_fds_; | ||
int timer_fd_; | ||
}; | ||
} // namespace topdown | ||
} // namespace counter | ||
} // namespace perf | ||
} // namespace lo2s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* This file is part of the lo2s software. | ||
* Linux OTF2 sampling | ||
* | ||
* Copyright (c) 2018, | ||
* Technische Universitaet Dresden, Germany | ||
* | ||
* lo2s is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* lo2s is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with lo2s. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <lo2s/perf/counter/counter_collection.hpp> | ||
#include <lo2s/perf/counter/metric_writer.hpp> | ||
#include <lo2s/perf/counter/topdown/reader.hpp> | ||
#include <lo2s/perf/time/converter.hpp> | ||
#include <lo2s/trace/trace.hpp> | ||
|
||
namespace lo2s | ||
{ | ||
namespace perf | ||
{ | ||
namespace counter | ||
{ | ||
namespace topdown | ||
{ | ||
class Writer : public Reader<Writer> | ||
{ | ||
public: | ||
Writer(ExecutionScope scope, trace::Trace& trace); | ||
|
||
bool handle(TopdownEvent* ev); | ||
|
||
private: | ||
time::Converter time_converter_; | ||
otf2::writer::local& writer_; | ||
otf2::definition::metric_instance metric_instance_; | ||
otf2::event::metric metric_event_; | ||
}; | ||
} // namespace topdown | ||
} // namespace counter | ||
} // namespace perf | ||
} // namespace lo2s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.