]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/perf_helper.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /* Copyright (c) 2011 Facebook
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHORS BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #include "include/buffer.h"
19 #include "common/error_code.h"
23 namespace PerfHelper
{
25 /// Flush the CPU data cache by reading and writing 100MB of new data.
28 int hundredMegs
= 100 * 1024 * 1024;
29 volatile char* block
= new char[hundredMegs
];
30 for (int i
= 0; i
< hundredMegs
; i
++)
35 /// Used in functionCall().
36 uint64_t plus_one(uint64_t x
)
41 /// Used in throwIntNL.
47 /// Used in throwExceptionNL.
48 void throw_end_of_buffer()
50 throw buffer::end_of_buffer();