Skip to content

Commit

Permalink
new files
Browse files Browse the repository at this point in the history
  • Loading branch information
aagimene committed Jan 24, 2015
1 parent efd6c98 commit b784b51
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Mitos.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "Mitos.h"

static perfsmpl m_perfsmpl;
static mattr m_mattr;

void Mitos_set_sample_mode(sample_mode m) { m_perfsmpl.set_sample_mode(m); }
void Mitos_set_sample_period(uint64_t p) { m_perfsmpl.set_sample_period(p); }
void Mitos_set_sample_threshold(uint64_t t) { m_perfsmpl.set_sample_threshold(t); }
void Mitos_set_handler(sample_handler_fn_t h) { m_perfsmpl.set_handler(h); }

void Mitos_prepare() { m_perfsmpl.prepare(); }
void Mitos_prepare(pid_t pid) { m_perfsmpl.prepare(pid); }
void Mitos_begin_sampler() { m_perfsmpl.begin_sampler(); }
void Mitos_end_sampler() { m_perfsmpl.end_sampler(); }

void Mitos_add_symbol(std::string n, void *a, size_t s, size_t l) { m_mattr.add_symbol(n,a,s,l); }

mem_symbol* Mitos_find_symbol(uint64_t addr) { return m_mattr.find_symbol(addr); }
23 changes: 23 additions & 0 deletions src/Mitos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "perfsmpl.h"
#include "mattr.h"

#include <string>

/*
* Mitos: performance event sampling library
* All programs must invoke from these functions.
*/
void Mitos_set_sample_mode(sample_mode m);
void Mitos_set_sample_period(uint64_t p);
void Mitos_set_sample_threshold(uint64_t t);
void Mitos_set_handler(sample_handler_fn_t h);

void Mitos_prepare();
void Mitos_prepare(pid_t pid);
void Mitos_begin_sampler();
void Mitos_end_sampler();

void Mitos_add_symbol(std::string n, void *a, size_t s, size_t l);

mem_symbol* Mitos_find_symbol(uint64_t addr);

0 comments on commit b784b51

Please sign in to comment.