-
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.
Merge pull request #299 from tud-zih-energy/issue-253-nec-sampling
feat(sampling): Implement sampling for NEC vector accelerators
- Loading branch information
Showing
19 changed files
with
573 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
find_path(Veosinfo_INCLUDE_DIRS veosinfo/veosinfo.h PATHS ENV C_INCLUDE_PATH ENV CPATH PATH_SUFFIXES include) | ||
|
||
find_library(Veosinfo_LIBRARIES veosinfo HINT ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) | ||
|
||
|
||
include (FindPackageHandleStandardArgs) | ||
|
||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Veosinfo DEFAULT_MSG Veosinfo_LIBRARIES Veosinfo_INCLUDE_DIRS) | ||
|
||
if(Veosinfo_FOUND) | ||
add_library(libveosinfo INTERFACE) | ||
target_link_libraries(libveosinfo INTERFACE ${Veosinfo_LIBRARIES}) | ||
target_include_directories(libveosinfo SYSTEM INTERFACE ${Veosinfo_INCLUDE_DIRS}) | ||
add_library(Veosinfo::veosinfo ALIAS libveosinfo) | ||
endif() | ||
|
||
mark_as_advanced(Veosinfo_LIBRARIES Veosinfo_INCLUDE_DIRS) |
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,69 @@ | ||
/* | ||
* This file is part of the lo2s software. | ||
* Linux OTF2 sampling | ||
* | ||
* Copyright (c) 2017, | ||
* 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/monitor/nec_thread_monitor.hpp> | ||
#include <lo2s/monitor/threaded_monitor.hpp> | ||
#include <lo2s/trace/trace.hpp> | ||
#include <lo2s/types.hpp> | ||
|
||
#include <filesystem> | ||
#include <utility> | ||
|
||
extern "C" | ||
{ | ||
#include <veosinfo/veosinfo.h> | ||
|
||
#include <libved.h> | ||
} | ||
|
||
namespace lo2s | ||
{ | ||
namespace nec | ||
{ | ||
class NecMonitorMain : public monitor::ThreadedMonitor | ||
{ | ||
public: | ||
NecMonitorMain(trace::Trace& trace, NecDevice device); | ||
|
||
void stop() override; | ||
|
||
protected: | ||
std::string group() const override | ||
{ | ||
return "nec::MonitorMain"; | ||
} | ||
|
||
void run() override; | ||
void finalize_thread() override; | ||
|
||
private: | ||
std::optional<NecDevice> get_device_of(Thread thread); | ||
std::vector<Thread> get_tasks_of(NecDevice device); | ||
std::map<Thread, NecThreadMonitor> monitors_; | ||
trace::Trace& trace_; | ||
NecDevice device_; | ||
std::atomic<bool> stopped_; | ||
ve_nodeinfo nodeinfo_; | ||
}; | ||
} // namespace nec | ||
} // 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,58 @@ | ||
/* | ||
* This file is part of the lo2s software. | ||
* Linux OTF2 sampling | ||
* | ||
* Copyright (c) 2016, | ||
* 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 <chrono> | ||
|
||
#include <lo2s/monitor/poll_monitor.hpp> | ||
#include <lo2s/perf/calling_context_manager.hpp> | ||
#include <lo2s/trace/trace.hpp> | ||
|
||
namespace lo2s | ||
{ | ||
namespace nec | ||
{ | ||
class NecThreadMonitor : public monitor::PollMonitor | ||
{ | ||
public: | ||
NecThreadMonitor(Thread thread, trace::Trace& trace, NecDevice device); | ||
|
||
protected: | ||
std::string group() const override | ||
{ | ||
return "nec::ThreadMonitor"; | ||
} | ||
|
||
void finalize_thread() override; | ||
|
||
void monitor(int fd) override; | ||
|
||
private: | ||
std::chrono::microseconds nec_read_interval_; | ||
otf2::writer::local& otf2_writer_; | ||
Thread nec_thread_; | ||
trace::Trace& trace_; | ||
NecDevice device_; | ||
perf::CallingContextManager cctx_manager_; | ||
}; | ||
} // namespace nec | ||
} // 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
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.