Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / perfglue / heap_profiler.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4  * Ceph - scalable distributed file system
5  *
6  * Copyright (C) 2011 New Dream Network/Sage Weil <sage@newdream.net>
7  *
8  * This is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License version 2.1, as published by the Free Software
11  * Foundation.  See file COPYING.
12  */
13 #ifndef HEAP_PROFILER_H_
14 #define HEAP_PROFILER_H_
15
16 #include <string>
17 #include <vector>
18 #include "common/config.h"
19
20 class LogClient;
21
22 /*
23  * Ceph glue for the Google perftools heap profiler, included
24  * as part of tcmalloc. This replaces ugly function pointers
25  * and #ifdef hacks!
26  */
27 bool ceph_using_tcmalloc();
28
29 /*
30  * Configure the heap profiler
31  */
32 void ceph_heap_profiler_init();
33
34 void ceph_heap_profiler_stats(char *buf, int length);
35
36 void ceph_heap_release_free_memory();
37
38 bool ceph_heap_profiler_running();
39
40 void ceph_heap_profiler_start();
41
42 void ceph_heap_profiler_stop();
43
44 void ceph_heap_profiler_dump(const char *reason);
45
46 bool ceph_heap_get_numeric_property(const char *property, size_t *value);
47
48 bool ceph_heap_set_numeric_property(const char *property, size_t value);
49
50 void ceph_heap_profiler_handle_command(const std::vector<std::string> &cmd,
51                                        ostream& out);
52
53 #endif /* HEAP_PROFILER_H_ */