]> git.proxmox.com Git - ceph.git/blob - ceph/src/perfglue/heap_profiler.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / 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 double ceph_heap_get_release_rate();
39
40 void ceph_heap_get_release_rate(double value);
41
42 bool ceph_heap_profiler_running();
43
44 void ceph_heap_profiler_start();
45
46 void ceph_heap_profiler_stop();
47
48 void ceph_heap_profiler_dump(const char *reason);
49
50 bool ceph_heap_get_numeric_property(const char *property, size_t *value);
51
52 bool ceph_heap_set_numeric_property(const char *property, size_t value);
53
54 void ceph_heap_profiler_handle_command(const std::vector<std::string> &cmd,
55 ostream& out);
56
57 #endif /* HEAP_PROFILER_H_ */