Files
Jungfraujoch/receiver/jfjoch_pcie_clear_net_counters.cpp

26 lines
706 B
C++

// Copyright (2019-2022) Paul Scherrer Institute
// SPDX-License-Identifier: GPL-3.0-or-later
#include <iostream>
#include "../common/JFJochException.h"
#include "PCIExpressDevice.h"
#include "../common/Logger.h"
int main(int argc, char **argv) {
Logger logger("jfjoch_pcie_clear_net_counters");
if (argc != 2) {
logger.Error("Usage: ./jfjoch_pcie_clear_net_counters <device name>");
exit(EXIT_FAILURE);
}
logger.Info("Device {}", argv[1]);
std::cout << std::endl;
try {
PCIExpressDevice test(argv[1], 0);
test.ClearNetworkCounters();
logger.Info("Done");
} catch (const JFJochException &e) {
logger.ErrorException(e);
}
}