souffle
2.0.2-371-g6315b36
|
#include "souffle/profile/CellInterface.h"
#include "souffle/profile/HtmlGenerator.h"
#include "souffle/profile/Iteration.h"
#include "souffle/profile/OutputProcessor.h"
#include "souffle/profile/ProfileDatabase.h"
#include "souffle/profile/ProfileEvent.h"
#include "souffle/profile/ProgramRun.h"
#include "souffle/profile/Reader.h"
#include "souffle/profile/Relation.h"
#include "souffle/profile/Row.h"
#include "souffle/profile/Rule.h"
#include "souffle/profile/StringUtils.h"
#include "souffle/profile/Table.h"
#include "souffle/profile/UserInputReader.h"
#include "souffle/utility/MiscUtil.h"
#include <algorithm>
#include <chrono>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <ratio>
#include <set>
#include <string>
#include <thread>
#include <unordered_map>
#include <utility>
#include <vector>
#include <dirent.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
Go to the source code of this file.
Data Structures | |
class | souffle::profile::Tui |
struct | souffle::profile::Tui::Usage |
Namespaces | |
souffle | |
souffle::profile | |
Functions | |
void | configuration () |
std::string | genJson () |
std::stringstream & | genJsonAtoms (std::stringstream &ss) |
std::stringstream & | genJsonConfiguration (std::stringstream &ss) |
std::stringstream & | souffle::genJsonRules (std::stringstream &ss, const std::string &name, size_t maxRows) |
std::stringstream & | souffle::genJsonUsage (std::stringstream &ss) |
uint32_t | getTermWidth () |
std::set< Usage > | getUsageStats (size_t width=size_t(-1)) |
void | graphBySize (std::vector< size_t > list) |
void | graphByTime (std::vector< std::chrono::microseconds > list) |
static void | help () |
void | id (std::string col) |
void | iterRel (std::string c, std::string col) |
void | iterRul (std::string c, std::string col) |
void | memoryUsage (std::chrono::microseconds, std::chrono::microseconds, uint32_t height=20) |
void | memoryUsage (uint32_t height=20) |
void | outputHtml (std::string filename="profiler_html/") |
void | quit () |
void | rel (size_t limit, bool showLimit=true) |
void | relRul (std::string str) |
void | rul (size_t limit, bool showLimit=true) |
void | setResultLimit (size_t limit) |
void | setupTabCompletion () |
void | top () |
void | updateDB () |
void | usage (std::chrono::microseconds endTime, std::chrono::microseconds startTime, uint32_t height=20) |
void | usage (uint32_t height=20) |
void | usageRelation (std::string id) |
void | usageRule (std::string id) |
void | verAtoms (Table &atomTable, const std::string &ruleName="") |
void | verGraph (std::string c, std::string col) |
void | verRul (std::string str) |
Variables | |
class souffle::profile::Tui | souffle::profile::ss |
void configuration | ( | ) |
Definition at line 1009 of file Tui.h.
References souffle::ProfileEventSingleton::instance(), and tinyformat::printf().
Referenced by souffle::profile::Tui::runCommand().
std::string genJson | ( | ) |
Definition at line 611 of file Tui.h.
References genJsonAtoms(), genJsonConfiguration(), souffle::profile::Tui::genJsonRelations(), souffle::genJsonRules(), souffle::profile::Tui::genJsonTop(), souffle::genJsonUsage(), souffle::profile::Tui::relationTable, souffle::profile::Table::rows, souffle::profile::Tui::ruleTable, and souffle::profile::ss.
Referenced by outputHtml().
std::stringstream& genJsonAtoms | ( | std::stringstream & | ss | ) |
Definition at line 549 of file Tui.h.
References souffle::profile::Tools::cleanJsonOut(), souffle::profile::Tools::cleanString(), souffle::profile::OutputProcessor::getProgramRun(), iteration, souffle::profile::Tui::out, relation, rule, and souffle::profile::ss.
Referenced by genJson().
std::stringstream& genJsonConfiguration | ( | std::stringstream & | ss | ) |
Definition at line 528 of file Tui.h.
References souffle::profile::Tools::cleanJsonOut(), souffle::ProfileEventSingleton::getDB(), souffle::ProfileEventSingleton::instance(), and souffle::profile::ss.
Referenced by genJson().
|
protected |
std::set<Usage> getUsageStats | ( | size_t | width = size_t(-1) | ) |
Definition at line 768 of file Tui.h.
References souffle::ProfileEventSingleton::getDB(), i, and souffle::ProfileEventSingleton::instance().
Referenced by souffle::genJsonUsage(), memoryUsage(), and usage().
void graphBySize | ( | std::vector< size_t > | list | ) |
Definition at line 1421 of file Tui.h.
References souffle::profile::Tools::formatNum(), i, j, l, souffle::profile::Tui::precision, and tinyformat::printf().
Referenced by iterRel(), iterRul(), and verGraph().
void graphByTime | ( | std::vector< std::chrono::microseconds > | list | ) |
Definition at line 1399 of file Tui.h.
References d, i, j, and tinyformat::printf().
Referenced by iterRel(), iterRul(), and verGraph().
|
static |
Definition at line 685 of file Tui.h.
References tinyformat::printf().
Referenced by souffle::profile::Tui::runCommand().
void id | ( | std::string | col | ) |
Definition at line 1124 of file Tui.h.
References souffle::profile::Tools::formatTable(), souffle::profile::Tui::precision, tinyformat::printf(), souffle::profile::Tui::ruleTable, and souffle::profile::Table::sort().
Referenced by souffle::ram::TupleOperation::getTupleId(), souffle::profile::Tui::runCommand(), and souffle::profile::Rule::setId().
void iterRel | ( | std::string | c, |
std::string | col | ||
) |
Definition at line 1250 of file Tui.h.
References souffle::profile::Tools::formatTable(), souffle::profile::OutputProcessor::getProgramRun(), graphBySize(), graphByTime(), i, souffle::profile::Tui::out, tinyformat::printf(), and souffle::profile::Tui::relationTable.
Referenced by souffle::profile::Tui::runCommand().
void iterRul | ( | std::string | c, |
std::string | col | ||
) |
Definition at line 1315 of file Tui.h.
References souffle::profile::Tools::formatTable(), souffle::profile::OutputProcessor::getProgramRun(), graphBySize(), graphByTime(), i, souffle::profile::Tui::out, souffle::profile::Tui::precision, tinyformat::printf(), rul(), and souffle::profile::Tui::ruleTable.
Referenced by souffle::profile::Tui::runCommand().
void memoryUsage | ( | std::chrono::microseconds | , |
std::chrono::microseconds | , | ||
uint32_t | height = 20 |
||
) |
Definition at line 944 of file Tui.h.
References souffle::profile::Tools::formatMemory(), getTermWidth(), getUsageStats(), i, j, tinyformat::printf(), and usage().
void memoryUsage | ( | uint32_t | height = 20 | ) |
Definition at line 940 of file Tui.h.
Referenced by souffle::profile::Tui::runCommand().
void outputHtml | ( | std::string | filename = "profiler_html/" | ) |
Definition at line 636 of file Tui.h.
References souffle::profile::Tools::file_exists(), genJson(), souffle::profile::HtmlGenerator::getHtml(), and i.
void quit | ( | ) |
Definition at line 679 of file Tui.h.
References souffle::profile::Tui::updater.
Referenced by souffle::profile::Tui::runProf().
void rel | ( | size_t | limit, |
bool | showLimit = true |
||
) |
Definition at line 1086 of file Tui.h.
References souffle::test::count(), souffle::profile::Tools::formatTable(), souffle::profile::Table::getRows(), souffle::profile::Tui::precision, tinyformat::printf(), souffle::profile::Tui::relationTable, souffle::profile::Tui::resultLimit, souffle::profile::Table::sort(), and souffle::profile::Tui::sortColumn.
Referenced by souffle::ParserDriver::addIoFromDeprecatedTag(), souffle::ast::Program::addRelation(), souffle::profile::Reader::addRelation(), souffle::SouffleProgram::addRelation(), souffle::ast::analysis::RecursiveClausesAnalysis::computeIsRecursive(), souffle::interpreter::Engine::execute(), souffle::ExplainProvenanceImpl::ExplainProvenanceImpl(), souffle::ExplainProvenanceImpl::findTuple(), souffle::profile::OutputProcessor::getAtomTable(), souffle::ast::transform::getInlinedLiteral(), souffle::profile::OutputProcessor::getRelTable(), souffle::profile::OutputProcessor::getRulTable(), souffle::profile::OutputProcessor::getSubrulTable(), souffle::synthesiser::Relation::getSynthesiserRelation(), souffle::ast::transform::MagicSetTransformer::getTriviallyIgnoredRelations(), souffle::profile::OutputProcessor::getVersionAtoms(), souffle::profile::OutputProcessor::getVersions(), souffle::ast::analysis::ProfileUseAnalysis::hasRelationSize(), souffle::interpreter::NodeGenerator::lookup(), souffle::ram::transform::MakeIndexTransformer::makeIndex(), souffle::ram::transform::ParallelTransformer::parallelizeOperations(), souffle::ast::transform::MagicSetTransformer::NormaliseDatabaseTransformer::partitionIO(), souffle::ast::analysis::SCCGraphAnalysis::print(), souffle::interpreter::ProgInterface::ProgInterface(), souffle::ExplainProvenanceImpl::queryProcess(), souffle::ast::transform::MinimiseProgramTransformer::reduceLocallyEquivalentClauses(), souffle::ast::transform::MinimiseProgramTransformer::reduceSingletonRelations(), souffle::ast::transform::RemoveEmptyRelationsTransformer::removeEmptyRelations(), souffle::ast::transform::RemoveRelationCopiesTransformer::removeRelationCopies(), souffle::profile::Tui::runCommand(), souffle::ast::analysis::SCCGraphAnalysis::SCCGraphAnalysis(), souffle::ast::transform::SemanticCheckerImpl::SemanticCheckerImpl(), top(), souffle::ast::transform::ComponentInstantiationTransformer::transform(), souffle::ast::transform::RemoveRedundantRelationsTransformer::transform(), souffle::ast::transform::ExecutionPlanChecker::transform(), souffle::ast::transform::IOAttributesTransformer::transform(), souffle::ast::transform::MagicSetTransformer::LabelDatabaseTransformer::PositiveLabellingTransformer::transform(), souffle::ast::transform::MagicSetTransformer::AdornDatabaseTransformer::transform(), souffle::ast2ram::AstToRamTranslator::translateNonRecursiveRelation(), souffle::ast2ram::AstToRamTranslator::translateRecursiveRelation(), usageRelation(), usageRule(), souffle::interpreter::NodeGenerator::visitLogSize(), and souffle::interpreter::NodeGenerator::visitQuery().
void relRul | ( | std::string | str | ) |
Definition at line 1142 of file Tui.h.
References souffle::profile::Tools::formatTable(), souffle::profile::OutputProcessor::getProgramRun(), souffle::profile::Tui::out, souffle::profile::Tui::precision, tinyformat::printf(), souffle::profile::Tui::relationTable, souffle::profile::Tui::ruleTable, souffle::profile::Table::sort(), souffle::profile::Tui::sortColumn, and str.
Referenced by souffle::profile::Tui::runCommand().
void rul | ( | size_t | limit, |
bool | showLimit = true |
||
) |
Definition at line 1106 of file Tui.h.
References souffle::test::count(), souffle::profile::Tools::formatTable(), souffle::profile::Table::getRows(), souffle::profile::Tui::precision, tinyformat::printf(), souffle::profile::Tui::resultLimit, souffle::profile::Tui::ruleTable, souffle::profile::Table::sort(), and souffle::profile::Tui::sortColumn.
Referenced by souffle::profile::Relation::createRecID(), souffle::genJsonRules(), souffle::profile::Relation::getRuleRecList(), souffle::profile::Relation::getTotalRecursiveRuleSize(), iterRul(), souffle::profile::Tui::runCommand(), top(), souffle::profile::Iteration::toString(), souffle::profile::Relation::toString(), and usageRule().
void setResultLimit | ( | size_t | limit | ) |
Definition at line 1082 of file Tui.h.
References souffle::profile::Tui::resultLimit.
Referenced by souffle::profile::Tui::runCommand().
void setupTabCompletion | ( | ) |
Definition at line 985 of file Tui.h.
References souffle::profile::InputReader::appendTabCompletion(), souffle::profile::InputReader::clearTabCompletion(), souffle::profile::Tools::formatTable(), souffle::profile::Tui::linereader, souffle::profile::Tui::precision, and souffle::profile::Tui::relationTable.
Referenced by souffle::profile::Tui::runCommand(), and souffle::profile::Tui::runProf().
void top | ( | ) |
Definition at line 1023 of file Tui.h.
References souffle::profile::Tui::alive, souffle::ProfileEventSingleton::getDB(), souffle::profile::OutputProcessor::getProgramRun(), souffle::profile::Table::getRows(), getTermWidth(), i, souffle::ProfileEventSingleton::instance(), souffle::profile::Tui::out, souffle::profile::Tui::precision, tinyformat::printf(), rel(), souffle::profile::Tui::relationTable, rul(), souffle::profile::Tui::ruleTable, and usage().
Referenced by souffle::profile::Tui::runCommand(), and souffle::profile::Tui::runProf().
|
protected |
Definition at line 1472 of file Tui.h.
References souffle::profile::OutputProcessor::getRelTable(), souffle::profile::OutputProcessor::getRulTable(), souffle::profile::Tui::out, souffle::profile::Tui::reader, souffle::profile::Tui::relationTable, and souffle::profile::Tui::ruleTable.
Referenced by souffle::profile::Tui::runCommand(), and souffle::profile::Tui::Tui().
void usage | ( | std::chrono::microseconds | endTime, |
std::chrono::microseconds | startTime, | ||
uint32_t | height = 20 |
||
) |
Definition at line 843 of file Tui.h.
References souffle::test::count(), souffle::profile::Tools::formatTime(), getTermWidth(), getUsageStats(), i, j, and tinyformat::printf().
void usage | ( | uint32_t | height = 20 | ) |
Definition at line 839 of file Tui.h.
Referenced by souffle::genJsonUsage(), memoryUsage(), souffle::profile::Tui::runCommand(), top(), usageRelation(), and usageRule().
void usageRelation | ( | std::string | id | ) |
Definition at line 715 of file Tui.h.
References souffle::profile::Tools::formatTable(), souffle::profile::OutputProcessor::getProgramRun(), souffle::profile::Tui::out, souffle::profile::Tui::precision, rel(), souffle::profile::Tui::relationTable, and usage().
Referenced by souffle::profile::Tui::runCommand().
void usageRule | ( | std::string | id | ) |
Definition at line 736 of file Tui.h.
References souffle::profile::Tools::formatTable(), souffle::profile::OutputProcessor::getProgramRun(), souffle::profile::Tui::out, souffle::profile::Tui::precision, rel(), rul(), souffle::profile::Tui::ruleTable, and usage().
Referenced by souffle::profile::Tui::runCommand().
|
protected |
Definition at line 1443 of file Tui.h.
References souffle::profile::OutputProcessor::getProgramRun(), souffle::profile::Tui::out, souffle::profile::Tui::precision, tinyformat::printf(), relation, rule, and souffle::toString().
Referenced by verRul().
void verGraph | ( | std::string | c, |
std::string | col | ||
) |
Definition at line 1363 of file Tui.h.
References souffle::profile::OutputProcessor::getVersions(), graphBySize(), graphByTime(), souffle::profile::Tui::out, tinyformat::printf(), and souffle::profile::Tools::split().
Referenced by souffle::profile::Tui::runCommand().
void verRul | ( | std::string | str | ) |
Definition at line 1181 of file Tui.h.
References souffle::profile::Tools::formatTable(), souffle::profile::OutputProcessor::getAtomTable(), souffle::profile::OutputProcessor::getVersionAtoms(), souffle::profile::OutputProcessor::getVersions(), souffle::profile::Tui::out, souffle::profile::Tui::precision, tinyformat::printf(), souffle::profile::Tui::ruleTable, souffle::profile::Table::sort(), souffle::profile::Tui::sortColumn, souffle::profile::Tools::split(), str, souffle::toString(), and verAtoms().
Referenced by souffle::profile::Tui::runCommand().