ATLAS Offline Software
Loading...
Searching...
No Matches
procmaps.h
Go to the documentation of this file.
1// dear emacs, this is -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef PROCMAPS_H
8#define PROCMAPS_H 1
9#include <vector>
10#include <string>
11#include <sys/types.h>
18class procmaps {
19public:
20 struct Entry {
21 Entry(const char* line);
22 unsigned long begAddress;
23 unsigned long endAddress;
27 bool isPrivate;
28 unsigned int offset;
29 unsigned int dev[2];
30 ino_t inode;
31 std::string pathname;
32 };
33
34 procmaps(size_t entries=1024);
35 //not yet procmaps(int pid);
36
37 typedef std::vector<Entry> procmaps_t;
38 typedef procmaps_t::const_iterator const_iterator;
39
42 const Entry* getEntry(const void* address, bool tryReloadMaps=true);
43
45 const procmaps_t& pmaps() const { return m_pmaps; }
46 const_iterator begin() const { return pmaps().begin(); }
47 const_iterator end() const { return pmaps().end(); }
48
50 void loadMaps(bool dump=false);
51
52private:
54};
55
56inline
58 return lhs.begAddress < rhs.begAddress;
59}
60#endif
void loadMaps(bool dump=false)
load/refresh info from /proc/self/map
Definition procmaps.cxx:47
const Entry * getEntry(const void *address, bool tryReloadMaps=true)
main entry point: get info for the page range containing address by default tries to reload /proc/sel...
Definition procmaps.cxx:59
const_iterator begin() const
Definition procmaps.h:46
procmaps(size_t entries=1024)
Definition procmaps.cxx:41
procmaps_t::const_iterator const_iterator
Definition procmaps.h:38
const_iterator end() const
Definition procmaps.h:47
const procmaps_t & pmaps() const
access underlying entries
Definition procmaps.h:45
std::vector< Entry > procmaps_t
Definition procmaps.h:37
procmaps_t m_pmaps
Definition procmaps.h:53
double entries
Definition listroot.cxx:49
-event-from-file
bool operator<(procmaps::Entry &lhs, procmaps::Entry &rhs)
Definition procmaps.h:57
Entry(const char *line)
Definition procmaps.cxx:11
ino_t inode
dev[0] major, dev[1] minor
Definition procmaps.h:30
unsigned int offset
=true page is private(COW), =false page is shared
Definition procmaps.h:28
unsigned int dev[2]
Definition procmaps.h:29
unsigned long endAddress
Definition procmaps.h:23
std::string pathname
Definition procmaps.h:31
unsigned long begAddress
Definition procmaps.h:22