souffle  2.0.2-371-g6315b36
EventProcessor.h
Go to the documentation of this file.
1 /*
2  * Souffle - A Datalog Compiler
3  * Copyright (c) 2018, The Souffle Developers. All rights reserved.
4  * Licensed under the Universal Permissive License v 1.0 as shown at:
5  * - https://opensource.org/licenses/UPL
6  * - <souffle root>/licenses/SOUFFLE-UPL.txt
7  */
8 
9 /************************************************************************
10  *
11  * @file EventProcessor.h
12  *
13  * Declares classes for event processor that parse profile events and
14  * populate the profile database
15  *
16  ***********************************************************************/
17 
18 #pragma once
19 
23 #include <cassert>
24 #include <chrono>
25 #include <cstdarg>
26 #include <cstdint>
27 #include <cstdlib>
28 #include <iostream>
29 #include <map>
30 #include <string>
31 #include <vector>
32 
33 namespace souffle {
34 namespace profile {
35 /**
36  * Abstract Class for EventProcessor
37  */
38 class EventProcessor {
39 public:
40  virtual ~EventProcessor() = default;
41 
42  /** abstract interface for processing an profile event */
43  virtual void process(ProfileDatabase&, const std::vector<std::string>& signature, va_list&) {
44  fatal("Unknown profiling processing event: %s", join(signature, " "));
45  }
46 };
47 
48 /**
49  * Event Processor Singleton
50  *
51  * Singleton that is the connection point for events
52  */
54 public:
55  /** get instance */
57  static EventProcessorSingleton singleton;
58  return singleton;
59  }
60 
61  /** register an event processor with its keyword */
62  void registerEventProcessor(const std::string& keyword, EventProcessor* processor) {
63  registry[keyword] = processor;
64  }
65 
66  /** process a profile event */
67  void process(ProfileDatabase& db, const char* txt, ...) {
68  va_list args;
69  va_start(args, txt);
70 
71  // escape signature
72  std::string escapedText = escape(txt);
73  // obtain event signature by splitting event text
74  std::vector<std::string> eventSignature = splitSignature(escapedText);
75 
76  // invoke the event processor of the event
77  const std::string& keyword = eventSignature[0];
78  assert(eventSignature.size() > 0 && "no keyword in event description");
79  assert(registry.find(keyword) != registry.end() && "EventProcessor not found!");
80  registry[keyword]->process(db, eventSignature, args);
81 
82  // terminate access to variadic arguments
83  va_end(args);
84  }
85 
86 private:
87  /** keyword / event processor mapping */
88  std::map<std::string, EventProcessor*> registry;
89 
90  EventProcessorSingleton() = default;
91 
92  /**
93  * Escape escape characters.
94  *
95  * Remove all escapes, then escape double quotes.
96  */
97  std::string escape(const std::string& text) {
98  std::string str(text);
99  size_t start_pos = 0;
100  // replace backslashes with double backslash
101  while ((start_pos = str.find('\\', start_pos)) != std::string::npos) {
102  if (start_pos == str.size()) {
103  break;
104  }
105  ++start_pos;
106  if (str[start_pos] != 't' && str[start_pos] != '"' && str[start_pos] != '\\' &&
107  str[start_pos] != 'n' && str[start_pos] != ';') {
108  str.replace(start_pos - 1, 1, "\\\\");
109  }
110  ++start_pos;
111  }
112  return str;
113  }
114 
115  /** split string */
116  static std::vector<std::string> split(std::string str, std::string split_str) {
117  // repeat value when splitting so "a b" -> ["a","b"] not ["a","","","","b"]
118  bool repeat = (split_str == " ");
119 
120  std::vector<std::string> elems;
121 
122  std::string temp;
123  std::string hold;
124  for (size_t i = 0; i < str.size(); i++) {
125  if (repeat) {
126  if (str.at(i) == split_str.at(0)) {
127  while (str.at(++i) == split_str.at(0)) {
128  ; // set i to be at the end of the search string
129  }
130  elems.push_back(temp);
131  temp = "";
132  }
133  temp += str.at(i);
134  } else {
135  temp += str.at(i);
136  hold += str.at(i);
137  for (size_t j = 0; j < hold.size(); j++) {
138  if (hold[j] != split_str[j]) {
139  hold = "";
140  }
141  }
142  if (hold.size() == split_str.size()) {
143  elems.push_back(temp.substr(0, temp.size() - hold.size()));
144  hold = "";
145  temp = "";
146  }
147  }
148  }
149  if (!temp.empty()) {
150  elems.push_back(temp);
151  }
152 
153  return elems;
154  }
155 
156  /** split string separated by semi-colon */
157  static std::vector<std::string> splitSignature(std::string str) {
158  for (size_t i = 0; i < str.size(); i++) {
159  if (i > 0 && str[i] == ';' && str[i - 1] == '\\') {
160  // I'm assuming this isn't a thing that will be naturally found in souffle profiler files
161  str[i - 1] = '\b';
162  str.erase(i--, 1);
163  }
164  }
165  std::vector<std::string> result = split(str, ";");
166  for (auto& i : result) {
167  for (char& j : i) {
168  if (j == '\b') {
169  j = ';';
170  }
171  }
172  }
173  return result;
174  }
175 };
176 
177 /**
178  * Non-Recursive Rule Timing Profile Event Processor
179  */
180 const class NonRecursiveRuleTimingProcessor : public EventProcessor {
181 public:
183  EventProcessorSingleton::instance().registerEventProcessor("@t-nonrecursive-rule", this);
184  }
185  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
186  const std::string& relation = signature[1];
187  const std::string& srcLocator = signature[2];
188  const std::string& rule = signature[3];
189  microseconds start = va_arg(args, microseconds);
190  microseconds end = va_arg(args, microseconds);
191  size_t startMaxRSS = va_arg(args, size_t);
192  size_t endMaxRSS = va_arg(args, size_t);
193  size_t size = va_arg(args, size_t);
194  db.addSizeEntry(
195  {"program", "relation", relation, "non-recursive-rule", rule, "maxRSS", "pre"}, startMaxRSS);
196  db.addSizeEntry(
197  {"program", "relation", relation, "non-recursive-rule", rule, "maxRSS", "post"}, endMaxRSS);
198  db.addTextEntry(
199  {"program", "relation", relation, "non-recursive-rule", rule, "source-locator"}, srcLocator);
200  db.addDurationEntry(
201  {"program", "relation", relation, "non-recursive-rule", rule, "runtime"}, start, end);
202  db.addSizeEntry({"program", "relation", relation, "non-recursive-rule", rule, "num-tuples"}, size);
203  }
205 
206 /**
207  * Non-Recursive Rule Number Profile Event Processor
208  */
209 const class NonRecursiveRuleNumberProcessor : public EventProcessor {
210 public:
212  EventProcessorSingleton::instance().registerEventProcessor("@n-nonrecursive-rule", this);
213  }
214  /** process event input */
215  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
216  const std::string& relation = signature[1];
217  const std::string& srcLocator = signature[2];
218  const std::string& rule = signature[3];
219  size_t num = va_arg(args, size_t);
220  db.addTextEntry(
221  {"program", "relation", relation, "non-recursive-rule", rule, "source-locator"}, srcLocator);
222  db.addSizeEntry({"program", "relation", relation, "non-recursive-rule", rule, "num-tuples"}, num);
223  }
225 
226 /**
227  * Recursive Rule Timing Profile Event Processor
228  */
230 public:
232  EventProcessorSingleton::instance().registerEventProcessor("@t-recursive-rule", this);
233  }
234  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
235  const std::string& relation = signature[1];
236  const std::string& version = signature[2];
237  const std::string& srcLocator = signature[3];
238  const std::string& rule = signature[4];
239  microseconds start = va_arg(args, microseconds);
240  microseconds end = va_arg(args, microseconds);
241  size_t startMaxRSS = va_arg(args, size_t);
242  size_t endMaxRSS = va_arg(args, size_t);
243  size_t size = va_arg(args, size_t);
244  std::string iteration = std::to_string(va_arg(args, size_t));
245  db.addSizeEntry({"program", "relation", relation, "iteration", iteration, "recursive-rule", rule,
246  version, "maxRSS", "pre"},
247  startMaxRSS);
248  db.addSizeEntry({"program", "relation", relation, "iteration", iteration, "recursive-rule", rule,
249  version, "maxRSS", "post"},
250  endMaxRSS);
251  db.addTextEntry({"program", "relation", relation, "iteration", iteration, "recursive-rule", rule,
252  version, "source-locator"},
253  srcLocator);
254  db.addDurationEntry({"program", "relation", relation, "iteration", iteration, "recursive-rule", rule,
255  version, "runtime"},
256  start, end);
257  db.addSizeEntry({"program", "relation", relation, "iteration", iteration, "recursive-rule", rule,
258  version, "num-tuples"},
259  size);
260  }
262 
263 /**
264  * Recursive Rule Number Profile Event Processor
265  */
266 const class RecursiveRuleNumberProcessor : public EventProcessor {
267 public:
269  EventProcessorSingleton::instance().registerEventProcessor("@n-recursive-rule", this);
270  }
271  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
272  const std::string& relation = signature[1];
273  const std::string& version = signature[2];
274  const std::string& srcLocator = signature[3];
275  const std::string& rule = signature[4];
276  size_t number = va_arg(args, size_t);
277  std::string iteration = std::to_string(va_arg(args, size_t));
278  db.addTextEntry({"program", "relation", relation, "iteration", iteration, "recursive-rule", rule,
279  version, "source-locator"},
280  srcLocator);
281  db.addSizeEntry({"program", "relation", relation, "iteration", iteration, "recursive-rule", rule,
282  version, "num-tuples"},
283  number);
284  }
286 
287 /**
288  * Non-Recursive Relation Number Profile Event Processor
289  */
291 public:
293  EventProcessorSingleton::instance().registerEventProcessor("@t-nonrecursive-relation", this);
294  }
295  /** process event input */
296  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
297  const std::string& relation = signature[1];
298  const std::string& srcLocator = signature[2];
299  microseconds start = va_arg(args, microseconds);
300  microseconds end = va_arg(args, microseconds);
301  size_t startMaxRSS = va_arg(args, size_t);
302  size_t endMaxRSS = va_arg(args, size_t);
303  size_t size = va_arg(args, size_t);
304  db.addSizeEntry({"program", "relation", relation, "maxRSS", "pre"}, startMaxRSS);
305  db.addSizeEntry({"program", "relation", relation, "maxRSS", "post"}, endMaxRSS);
306  db.addSizeEntry({"program", "relation", relation, "num-tuples"}, size);
307  db.addTextEntry({"program", "relation", relation, "source-locator"}, srcLocator);
308  db.addDurationEntry({"program", "relation", relation, "runtime"}, start, end);
309  }
311 
312 /**
313  * Non-Recursive Relation Number Profile Event Processor
314  */
316 public:
318  EventProcessorSingleton::instance().registerEventProcessor("@n-nonrecursive-relation", this);
319  }
320  /** process event input */
321  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
322  const std::string& relation = signature[1];
323  const std::string& srcLocator = signature[2];
324  size_t num = va_arg(args, size_t);
325  db.addTextEntry({"program", "relation", relation, "source-locator"}, srcLocator);
326  db.addSizeEntry({"program", "relation", relation, "num-tuples"}, num);
327  }
329 
330 /**
331  * Recursive Relation Timing Profile Event Processor
332  */
334 public:
336  EventProcessorSingleton::instance().registerEventProcessor("@t-recursive-relation", this);
337  }
338  /** process event input */
339  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
340  const std::string& relation = signature[1];
341  const std::string& srcLocator = signature[2];
342  microseconds start = va_arg(args, microseconds);
343  microseconds end = va_arg(args, microseconds);
344  size_t startMaxRSS = va_arg(args, size_t);
345  size_t endMaxRSS = va_arg(args, size_t);
346  size_t size = va_arg(args, size_t);
347  std::string iteration = std::to_string(va_arg(args, size_t));
348  db.addTextEntry({"program", "relation", relation, "source-locator"}, srcLocator);
349  db.addDurationEntry({"program", "relation", relation, "iteration", iteration, "runtime"}, start, end);
350  db.addSizeEntry(
351  {"program", "relation", relation, "iteration", iteration, "maxRSS", "pre"}, startMaxRSS);
352  db.addSizeEntry(
353  {"program", "relation", relation, "iteration", iteration, "maxRSS", "post"}, endMaxRSS);
354  db.addSizeEntry({"program", "relation", relation, "iteration", iteration, "num-tuples"}, size);
355  }
357 
358 /**
359  * Recursive Relation Timing Profile Event Processor
360  */
361 const class RecursiveRelationNumberProcessor : public EventProcessor {
362 public:
364  EventProcessorSingleton::instance().registerEventProcessor("@n-recursive-relation", this);
365  }
366  /** process event input */
367  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
368  const std::string& relation = signature[1];
369  const std::string& srcLocator = signature[2];
370  size_t number = va_arg(args, size_t);
371  std::string iteration = std::to_string(va_arg(args, size_t));
372  db.addTextEntry({"program", "relation", relation, "source-locator"}, srcLocator);
373  db.addSizeEntry({"program", "relation", relation, "iteration", iteration, "num-tuples"}, number);
374  }
376 
377 /**
378  * Recursive Relation Copy Timing Profile Event Processor
379  */
381 public:
383  EventProcessorSingleton::instance().registerEventProcessor("@c-recursive-relation", this);
384  }
385  /** process event input */
386  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
387  const std::string& relation = signature[1];
388  const std::string& srcLocator = signature[2];
389  microseconds start = va_arg(args, microseconds);
390  microseconds end = va_arg(args, microseconds);
391  size_t startMaxRSS = va_arg(args, size_t);
392  size_t endMaxRSS = va_arg(args, size_t);
393  va_arg(args, size_t);
394  std::string iteration = std::to_string(va_arg(args, size_t));
395  db.addSizeEntry(
396  {"program", "relation", relation, "iteration", iteration, "maxRSS", "pre"}, startMaxRSS);
397  db.addSizeEntry(
398  {"program", "relation", relation, "iteration", iteration, "maxRSS", "post"}, endMaxRSS);
399  db.addTextEntry({"program", "relation", relation, "source-locator"}, srcLocator);
400  db.addDurationEntry(
401  {"program", "relation", relation, "iteration", iteration, "copytime"}, start, end);
402  }
404 
405 /**
406  * Recursive Relation Copy Timing Profile Event Processor
407  */
408 const class RelationIOTimingProcessor : public EventProcessor {
409 public:
411  EventProcessorSingleton::instance().registerEventProcessor("@t-relation-savetime", this);
412  EventProcessorSingleton::instance().registerEventProcessor("@t-relation-loadtime", this);
413  }
414  /** process event input */
415  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
416  const std::string& relation = signature[1];
417  const std::string& srcLocator = signature[2];
418  const std::string ioType = signature[3];
419  microseconds start = va_arg(args, microseconds);
420  microseconds end = va_arg(args, microseconds);
421  db.addTextEntry({"program", "relation", relation, "source-locator"}, srcLocator);
422  db.addDurationEntry({"program", "relation", relation, ioType}, start, end);
423  }
425 
426 /**
427  * Program Run Event Processor
428  */
430 public:
433  }
434  /** process event input */
435  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
436  microseconds time = va_arg(args, microseconds);
437  auto path = signature;
438  path[0] = "program";
439  db.addTimeEntry(path, time);
440  }
442 
443 /**
444  * Program Run Event Processor
445  */
446 const class ProgramRuntimeProcessor : public EventProcessor {
447 public:
450  }
451  /** process event input */
452  void process(
453  ProfileDatabase& db, const std::vector<std::string>& /* signature */, va_list& args) override {
454  microseconds start = va_arg(args, microseconds);
455  microseconds end = va_arg(args, microseconds);
456  db.addDurationEntry({"program", "runtime"}, start, end);
457  }
459 
460 /**
461  * Program Resource Utilisation Event Processor
462  */
464 public:
467  }
468  /** process event input */
469  void process(
470  ProfileDatabase& db, const std::vector<std::string>& /* signature */, va_list& args) override {
471  microseconds time = va_arg(args, microseconds);
472  uint64_t systemTime = va_arg(args, uint64_t);
473  uint64_t userTime = va_arg(args, uint64_t);
474  size_t maxRSS = va_arg(args, size_t);
475  std::string timeString = std::to_string(time.count());
476  db.addSizeEntry({"program", "usage", "timepoint", timeString, "systemtime"}, systemTime);
477  db.addSizeEntry({"program", "usage", "timepoint", timeString, "usertime"}, userTime);
478  db.addSizeEntry({"program", "usage", "timepoint", timeString, "maxRSS"}, maxRSS);
479  }
481 
482 /**
483  * Frequency Atom Processor
484  */
485 const class FrequencyAtomProcessor : public EventProcessor {
486 public:
489  }
490  /** process event input */
491  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
492  const std::string& relation = signature[1];
493  const std::string& version = signature[2];
494  const std::string& rule = signature[3];
495  const std::string& atom = signature[4];
496  const std::string& originalRule = signature[5];
497  size_t level = std::stoi(signature[6]);
498  size_t number = va_arg(args, size_t);
499  size_t iteration = va_arg(args, size_t);
500  // non-recursive rule
501  if (rule == originalRule) {
502  db.addSizeEntry({"program", "relation", relation, "non-recursive-rule", rule, "atom-frequency",
503  rule, atom, "level"},
504  level);
505  db.addSizeEntry({"program", "relation", relation, "non-recursive-rule", rule, "atom-frequency",
506  rule, atom, "num-tuples"},
507  number);
508  } else {
509  db.addSizeEntry(
510  {"program", "relation", relation, "iteration", std::to_string(iteration),
511  "recursive-rule", originalRule, version, "atom-frequency", rule, atom, "level"},
512  level);
513  db.addSizeEntry({"program", "relation", relation, "iteration", std::to_string(iteration),
514  "recursive-rule", originalRule, version, "atom-frequency", rule, atom,
515  "num-tuples"},
516  number);
517  }
518  }
520 
521 /**
522  * Reads Processor
523  */
524 const class RelationReadsProcessor : public EventProcessor {
525 public:
528  }
529  /** process event input */
530  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
531  const std::string& relation = signature[1];
532  size_t reads = va_arg(args, size_t);
533  db.addSizeEntry({"program", "relation", relation, "reads"}, reads);
534  }
535 
537 
538 /**
539  * Config entry processor
540  */
541 const class ConfigProcessor : public EventProcessor {
542 public:
543  ConfigProcessor() {
545  }
546  void process(
547  ProfileDatabase& db, const std::vector<std::string>& /* signature */, va_list& args) override {
548  const std::string key = va_arg(args, char*);
549  const std::string& value = va_arg(args, char*);
550  db.addTextEntry({"program", "configuration", key}, value);
551  }
553 
554 /**
555  * Text entry processor
556  */
557 const class TextProcessor : public EventProcessor {
558 public:
559  TextProcessor() {
561  }
562  void process(ProfileDatabase& db, const std::vector<std::string>& signature, va_list& args) override {
563  const std::string text = va_arg(args, char*);
564  auto path = signature;
565  path.front() = "program";
566  db.addTextEntry(path, text);
567  }
568 } textProcessor;
569 
570 } // namespace profile
571 } // namespace souffle
souffle::profile::EventProcessorSingleton::process
void process(ProfileDatabase &db, const char *txt,...)
process a profile event
Definition: EventProcessor.h:81
souffle::profile::RelationIOTimingProcessor::RelationIOTimingProcessor
RelationIOTimingProcessor()
Definition: EventProcessor.h:424
TCB_SPAN_NAMESPACE_NAME::detail::size
constexpr auto size(const C &c) -> decltype(c.size())
Definition: span.h:198
souffle::profile::ProgramResourceUtilisationProcessor
Program Resource Utilisation Event Processor.
Definition: EventProcessor.h:477
souffle::profile::FrequencyAtomProcessor::FrequencyAtomProcessor
FrequencyAtomProcessor()
Definition: EventProcessor.h:501
souffle::profile::RecursiveRelationTimingProcessor
Recursive Relation Timing Profile Event Processor.
Definition: EventProcessor.h:347
souffle::profile::ProgramRuntimeProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &, va_list &args) override
process event input
Definition: EventProcessor.h:466
souffle::profile::RecursiveRuleTimingProcessor::RecursiveRuleTimingProcessor
RecursiveRuleTimingProcessor()
Definition: EventProcessor.h:245
souffle::profile::recursiveRuleTimingProcessor
souffle::profile::RecursiveRuleTimingProcessor recursiveRuleTimingProcessor
souffle::profile::ProgramRuntimeProcessor
Program Run Event Processor.
Definition: EventProcessor.h:460
souffle::profile::NonRecursiveRelationNumberProcessor
Non-Recursive Relation Number Profile Event Processor.
Definition: EventProcessor.h:329
souffle::profile::ProgramTimepointProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
process event input
Definition: EventProcessor.h:449
souffle::profile::RecursiveRuleTimingProcessor
Recursive Rule Timing Profile Event Processor.
Definition: EventProcessor.h:243
souffle::profile::EventProcessorSingleton::splitSignature
static std::vector< std::string > splitSignature(std::string str)
split string separated by semi-colon
Definition: EventProcessor.h:171
souffle::profile::TextProcessor
Text entry processor.
Definition: EventProcessor.h:571
souffle::profile::RecursiveRuleTimingProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
abstract interface for processing an profile event
Definition: EventProcessor.h:248
souffle::profile::programRuntimeProcessor
souffle::profile::ProgramRuntimeProcessor programRuntimeProcessor
souffle::profile::RecursiveRuleNumberProcessor::RecursiveRuleNumberProcessor
RecursiveRuleNumberProcessor()
Definition: EventProcessor.h:282
souffle::profile::NonRecursiveRuleTimingProcessor::NonRecursiveRuleTimingProcessor
NonRecursiveRuleTimingProcessor()
Definition: EventProcessor.h:196
relation
Relation & relation
Definition: Reader.h:130
souffle::profile::nonRecursiveRelationNumberProcessor
souffle::profile::NonRecursiveRelationNumberProcessor nonRecursiveRelationNumberProcessor
souffle::profile::ProgramRuntimeProcessor::ProgramRuntimeProcessor
ProgramRuntimeProcessor()
Definition: EventProcessor.h:462
MiscUtil.h
souffle::profile::RecursiveRelationTimingProcessor::RecursiveRelationTimingProcessor
RecursiveRelationTimingProcessor()
Definition: EventProcessor.h:349
souffle::profile::RelationIOTimingProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
process event input
Definition: EventProcessor.h:429
souffle::profile::NonRecursiveRuleNumberProcessor::NonRecursiveRuleNumberProcessor
NonRecursiveRuleNumberProcessor()
Definition: EventProcessor.h:225
souffle::profile::nonRecursiveRuleNumberProcessor
souffle::profile::NonRecursiveRuleNumberProcessor nonRecursiveRuleNumberProcessor
iteration
Iteration & iteration
Definition: Reader.h:129
souffle::profile::EventProcessor::process
virtual void process(ProfileDatabase &, const std::vector< std::string > &signature, va_list &)
abstract interface for processing an profile event
Definition: EventProcessor.h:64
j
var j
Definition: htmlJsChartistMin.h:15
souffle::profile::RecursiveRuleNumberProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
abstract interface for processing an profile event
Definition: EventProcessor.h:285
souffle::profile::ConfigProcessor
Config entry processor.
Definition: EventProcessor.h:555
souffle::profile::RecursiveRelationTimingProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
process event input
Definition: EventProcessor.h:353
souffle::profile::recursiveRelationCopyTimingProcessor
souffle::profile::RecursiveRelationCopyTimingProcessor recursiveRelationCopyTimingProcessor
str
const std::string & str
Definition: json11.h:662
souffle::profile::RecursiveRelationCopyTimingProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
process event input
Definition: EventProcessor.h:400
souffle::profile::NonRecursiveRuleTimingProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
abstract interface for processing an profile event
Definition: EventProcessor.h:199
i
size_t i
Definition: json11.h:663
souffle::profile::ConfigProcessor::ConfigProcessor
ConfigProcessor()
Definition: EventProcessor.h:557
souffle::profile::TextProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
abstract interface for processing an profile event
Definition: EventProcessor.h:576
souffle::join
detail::joined_sequence< Iter, Printer > join(const Iter &a, const Iter &b, const std::string &sep, const Printer &p)
Creates an object to be forwarded to some output stream for printing sequences of elements interspers...
Definition: StreamUtil.h:175
souffle::profile::relationReadsProcessor
souffle::profile::RelationReadsProcessor relationReadsProcessor
souffle::profile::nonRecursiveRuleTimingProcessor
souffle::profile::NonRecursiveRuleTimingProcessor nonRecursiveRuleTimingProcessor
souffle::profile::recursiveRelationTimingProcessor
souffle::profile::RecursiveRelationTimingProcessor recursiveRelationTimingProcessor
souffle::profile::RecursiveRelationCopyTimingProcessor::RecursiveRelationCopyTimingProcessor
RecursiveRelationCopyTimingProcessor()
Definition: EventProcessor.h:396
souffle::profile::EventProcessorSingleton::registry
std::map< std::string, EventProcessor * > registry
keyword / event processor mapping
Definition: EventProcessor.h:102
souffle::profile::EventProcessorSingleton::split
static std::vector< std::string > split(std::string str, std::string split_str)
split string
Definition: EventProcessor.h:130
souffle::profile::ProgramResourceUtilisationProcessor::ProgramResourceUtilisationProcessor
ProgramResourceUtilisationProcessor()
Definition: EventProcessor.h:479
souffle::profile::RelationReadsProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
process event input
Definition: EventProcessor.h:544
souffle::profile::RecursiveRelationCopyTimingProcessor
Recursive Relation Copy Timing Profile Event Processor.
Definition: EventProcessor.h:394
souffle::profile::ConfigProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &, va_list &args) override
abstract interface for processing an profile event
Definition: EventProcessor.h:560
souffle::profile::programResourceUtilisationProcessor
souffle::profile::ProgramResourceUtilisationProcessor programResourceUtilisationProcessor
souffle::profile::textProcessor
souffle::profile::TextProcessor textProcessor
souffle::profile::nonRecursiveRelationTimingProcessor
souffle::profile::NonRecursiveRelationTimingProcessor nonRecursiveRelationTimingProcessor
souffle::profile::NonRecursiveRuleNumberProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
process event input
Definition: EventProcessor.h:229
souffle::profile::RecursiveRelationNumberProcessor::RecursiveRelationNumberProcessor
RecursiveRelationNumberProcessor()
Definition: EventProcessor.h:377
souffle::profile::RecursiveRelationNumberProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
process event input
Definition: EventProcessor.h:381
souffle::profile::frequencyAtomProcessor
souffle::profile::FrequencyAtomProcessor frequencyAtomProcessor
souffle::profile::relationIOTimingProcessor
souffle::profile::RelationIOTimingProcessor relationIOTimingProcessor
souffle::profile::EventProcessorSingleton
Event Processor Singleton.
Definition: EventProcessor.h:67
souffle::profile::recursiveRuleNumberProcessor
souffle::profile::RecursiveRuleNumberProcessor recursiveRuleNumberProcessor
souffle::profile::FrequencyAtomProcessor
Frequency Atom Processor.
Definition: EventProcessor.h:499
souffle::test::time
long time(const std::string &name, const Op &operation)
Definition: btree_multiset_test.cpp:411
souffle::profile::NonRecursiveRelationTimingProcessor
Non-Recursive Relation Number Profile Event Processor.
Definition: EventProcessor.h:304
souffle::profile::RelationReadsProcessor::RelationReadsProcessor
RelationReadsProcessor()
Definition: EventProcessor.h:540
souffle::profile::ProgramTimepointProcessor::ProgramTimepointProcessor
ProgramTimepointProcessor()
Definition: EventProcessor.h:445
souffle::profile::ProgramResourceUtilisationProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &, va_list &args) override
process event input
Definition: EventProcessor.h:483
souffle::profile::NonRecursiveRelationNumberProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
process event input
Definition: EventProcessor.h:335
rule
Rule & rule
Definition: Reader.h:85
souffle::profile::EventProcessor::~EventProcessor
virtual ~EventProcessor()=default
StreamUtil.h
souffle::fatal
void fatal(const char *format, const Args &... args)
Definition: MiscUtil.h:198
souffle
Definition: AggregateOp.h:25
souffle::profile::NonRecursiveRelationTimingProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
process event input
Definition: EventProcessor.h:310
souffle::profile::FrequencyAtomProcessor::process
void process(ProfileDatabase &db, const std::vector< std::string > &signature, va_list &args) override
process event input
Definition: EventProcessor.h:505
souffle::profile::recursiveRelationNumberProcessor
souffle::profile::RecursiveRelationNumberProcessor recursiveRelationNumberProcessor
ProfileDatabase.h
souffle::profile::ProgramTimepointProcessor
Program Run Event Processor.
Definition: EventProcessor.h:443
souffle::profile::EventProcessorSingleton::EventProcessorSingleton
EventProcessorSingleton()=default
souffle::profile::EventProcessorSingleton::registerEventProcessor
void registerEventProcessor(const std::string &keyword, EventProcessor *processor)
register an event processor with its keyword
Definition: EventProcessor.h:76
souffle::profile::configProcessor
souffle::profile::ConfigProcessor configProcessor
souffle::profile::NonRecursiveRelationNumberProcessor::NonRecursiveRelationNumberProcessor
NonRecursiveRelationNumberProcessor()
Definition: EventProcessor.h:331
souffle::profile::EventProcessorSingleton::escape
std::string escape(const std::string &text)
Escape escape characters.
Definition: EventProcessor.h:111
souffle::profile::NonRecursiveRelationTimingProcessor::NonRecursiveRelationTimingProcessor
NonRecursiveRelationTimingProcessor()
Definition: EventProcessor.h:306
souffle::profile::programTimepointProcessor
souffle::profile::ProgramTimepointProcessor programTimepointProcessor
souffle::profile::EventProcessorSingleton::instance
static EventProcessorSingleton & instance()
get instance
Definition: EventProcessor.h:70
souffle::profile::TextProcessor::TextProcessor
TextProcessor()
Definition: EventProcessor.h:573
souffle::profile::EventProcessor
Abstract Class for EventProcessor.
Definition: EventProcessor.h:52