aboutsummaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-12-19 03:38:19 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-12-19 14:15:54 +0000
commit2e0bc6c08d1735240c7991a91cbe45ba9ef8badd (patch)
tree12cd5597d274b7b7c82527b5e3d9e390510dbb4a /staging_vespalib
parentd02f3514af433dcbddc739421549e3f527b5af4c (diff)
GC unused code and only include the stuff needed.
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/CMakeLists.txt1
-rw-r--r--staging_vespalib/src/testlist.txt1
-rw-r--r--staging_vespalib/src/tests/cpu/.gitignore4
-rw-r--r--staging_vespalib/src/tests/cpu/CMakeLists.txt8
-rw-r--r--staging_vespalib/src/tests/cpu/DESC1
-rw-r--r--staging_vespalib/src/tests/cpu/FILES1
-rw-r--r--staging_vespalib/src/tests/cpu/cpu_test.cpp33
-rw-r--r--staging_vespalib/src/vespa/vespalib/data/databuffer.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/encoding/base64.cpp3
-rw-r--r--staging_vespalib/src/vespa/vespalib/net/http_server.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/net/json_handler_repo.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h1
-rw-r--r--staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/net/simple_health_producer.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/net/simple_metric_snapshot.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/net/simple_metrics_producer.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/net/state_api.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/net/state_server.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/deserializer.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/fieldbase.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/namedobject.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/nboserializer.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/objectdumper.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/objectoperation.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/objectpredicate.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/objectvisitor.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/serializer.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/valuetype.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/visit.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/CMakeLists.txt1
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/bits.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/bits.h3
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/cpu.cpp142
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/cpu.h95
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/crc.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp3
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/doom.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/process_memory_stats.cpp1
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/process_memory_stats.h5
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/programoptions.cpp3
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/rusage.cpp41
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp2
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/shutdownguard.h1
44 files changed, 31 insertions, 343 deletions
diff --git a/staging_vespalib/CMakeLists.txt b/staging_vespalib/CMakeLists.txt
index 652200e2d7b..0f08ddc6791 100644
--- a/staging_vespalib/CMakeLists.txt
+++ b/staging_vespalib/CMakeLists.txt
@@ -12,7 +12,6 @@ vespa_define_module(
src/tests/benchmark
src/tests/bits
src/tests/clock
- src/tests/cpu
src/tests/crc
src/tests/databuffer
src/tests/directio
diff --git a/staging_vespalib/src/testlist.txt b/staging_vespalib/src/testlist.txt
index e67614239b2..3856ebba9b8 100644
--- a/staging_vespalib/src/testlist.txt
+++ b/staging_vespalib/src/testlist.txt
@@ -2,7 +2,6 @@ tests/array
tests/benchmark
tests/bits
tests/clock
-tests/cpu
tests/crc
tests/databuffer
tests/directio
diff --git a/staging_vespalib/src/tests/cpu/.gitignore b/staging_vespalib/src/tests/cpu/.gitignore
deleted file mode 100644
index eea6ced9753..00000000000
--- a/staging_vespalib/src/tests/cpu/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.depend
-Makefile
-cpu_test
-staging_vespalib_cpu_test_app
diff --git a/staging_vespalib/src/tests/cpu/CMakeLists.txt b/staging_vespalib/src/tests/cpu/CMakeLists.txt
deleted file mode 100644
index 665c662bbf2..00000000000
--- a/staging_vespalib/src/tests/cpu/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-vespa_add_executable(staging_vespalib_cpu_test_app TEST
- SOURCES
- cpu_test.cpp
- DEPENDS
- staging_vespalib
-)
-vespa_add_test(NAME staging_vespalib_cpu_test_app COMMAND staging_vespalib_cpu_test_app)
diff --git a/staging_vespalib/src/tests/cpu/DESC b/staging_vespalib/src/tests/cpu/DESC
deleted file mode 100644
index 19de1b44450..00000000000
--- a/staging_vespalib/src/tests/cpu/DESC
+++ /dev/null
@@ -1 +0,0 @@
-cpu special instructions test. Take a look at cpu.cpp for details.
diff --git a/staging_vespalib/src/tests/cpu/FILES b/staging_vespalib/src/tests/cpu/FILES
deleted file mode 100644
index 6abb996b510..00000000000
--- a/staging_vespalib/src/tests/cpu/FILES
+++ /dev/null
@@ -1 +0,0 @@
-cpu.cpp
diff --git a/staging_vespalib/src/tests/cpu/cpu_test.cpp b/staging_vespalib/src/tests/cpu/cpu_test.cpp
deleted file mode 100644
index 56f109e47a4..00000000000
--- a/staging_vespalib/src/tests/cpu/cpu_test.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("cpu_test");
-#include <vespa/vespalib/testkit/testapp.h>
-#include <vespa/vespalib/util/cpu.h>
-
-using namespace vespalib;
-
-class Test : public vespalib::TestApp
-{
-public:
- int Main();
-};
-
-int Test::Main()
-{
- TEST_INIT("cpu_test");
-
- const X86CpuInfo & cpu = X86CpuInfo::cpuInfo();
- EXPECT_TRUE(cpu.hasMMX());
- EXPECT_TRUE(cpu.hasSSE());
- EXPECT_TRUE(cpu.hasSSE2());
- EXPECT_TRUE(cpu.hasSSE3());
- EXPECT_TRUE(cpu.hasCX16());
-
- X86CpuInfo::print(stdout);
-
- TEST_FLUSH();
- TEST_DONE();
-}
-
-TEST_APPHOOK(Test)
diff --git a/staging_vespalib/src/vespa/vespalib/data/databuffer.cpp b/staging_vespalib/src/vespa/vespalib/data/databuffer.cpp
index 54baf0e8b60..e862d413bbc 100644
--- a/staging_vespalib/src/vespa/vespalib/data/databuffer.cpp
+++ b/staging_vespalib/src/vespa/vespalib/data/databuffer.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "databuffer.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/encoding/base64.cpp b/staging_vespalib/src/vespa/vespalib/encoding/base64.cpp
index cafa84f2b50..10bc2af51ce 100644
--- a/staging_vespalib/src/vespa/vespalib/encoding/base64.cpp
+++ b/staging_vespalib/src/vespa/vespalib/encoding/base64.cpp
@@ -6,10 +6,9 @@
*
*/
-#include <vespa/fastos/fastos.h>
-#include <assert.h>
#include <vespa/vespalib/encoding/base64.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <assert.h>
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/net/http_server.cpp b/staging_vespalib/src/vespa/vespalib/net/http_server.cpp
index 0696d65a3cb..211d4f2c810 100644
--- a/staging_vespalib/src/vespa/vespalib/net/http_server.cpp
+++ b/staging_vespalib/src/vespa/vespalib/net/http_server.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "http_server.h"
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/host_name.h>
diff --git a/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.cpp b/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.cpp
index 7ab6d8f1e75..63a13bc597e 100644
--- a/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.cpp
+++ b/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "json_handler_repo.h"
#include <algorithm>
diff --git a/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h b/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h
index 0e27d895f52..101ce3d3c54 100644
--- a/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h
+++ b/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h
@@ -5,6 +5,7 @@
#include "json_get_handler.h"
#include <mutex>
#include <memory>
+#include <vector>
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.cpp b/staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.cpp
index 7f873e26dd1..edfd9ef2f4d 100644
--- a/staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.cpp
+++ b/staging_vespalib/src/vespa/vespalib/net/simple_component_config_producer.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "simple_component_config_producer.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/net/simple_health_producer.cpp b/staging_vespalib/src/vespa/vespalib/net/simple_health_producer.cpp
index 002710b6e14..9d7b8bbbce5 100644
--- a/staging_vespalib/src/vespa/vespalib/net/simple_health_producer.cpp
+++ b/staging_vespalib/src/vespa/vespalib/net/simple_health_producer.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "simple_health_producer.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/net/simple_metric_snapshot.cpp b/staging_vespalib/src/vespa/vespalib/net/simple_metric_snapshot.cpp
index de9db86e69a..9ec6f90463c 100644
--- a/staging_vespalib/src/vespa/vespalib/net/simple_metric_snapshot.cpp
+++ b/staging_vespalib/src/vespa/vespalib/net/simple_metric_snapshot.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "simple_metric_snapshot.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/net/simple_metrics_producer.cpp b/staging_vespalib/src/vespa/vespalib/net/simple_metrics_producer.cpp
index 586226d5277..e9928f6df08 100644
--- a/staging_vespalib/src/vespa/vespalib/net/simple_metrics_producer.cpp
+++ b/staging_vespalib/src/vespa/vespalib/net/simple_metrics_producer.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "simple_metrics_producer.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/net/state_api.cpp b/staging_vespalib/src/vespa/vespalib/net/state_api.cpp
index 924aec54cf2..2c2dc55060d 100644
--- a/staging_vespalib/src/vespa/vespalib/net/state_api.cpp
+++ b/staging_vespalib/src/vespa/vespalib/net/state_api.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "state_api.h"
#include <vespa/vespalib/util/jsonwriter.h>
diff --git a/staging_vespalib/src/vespa/vespalib/net/state_server.cpp b/staging_vespalib/src/vespa/vespalib/net/state_server.cpp
index 8529c0c1f84..6e81a73840f 100644
--- a/staging_vespalib/src/vespa/vespalib/net/state_server.cpp
+++ b/staging_vespalib/src/vespa/vespalib/net/state_server.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "state_server.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/objects/deserializer.cpp b/staging_vespalib/src/vespa/vespalib/objects/deserializer.cpp
index 3a87c616362..a42502ec0a6 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/deserializer.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/deserializer.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "deserializer.h"
#include "identifiable.h"
diff --git a/staging_vespalib/src/vespa/vespalib/objects/fieldbase.cpp b/staging_vespalib/src/vespa/vespalib/objects/fieldbase.cpp
index a8011adf5ad..f2800ca6ab5 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/fieldbase.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/fieldbase.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "fieldbase.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/objects/namedobject.cpp b/staging_vespalib/src/vespa/vespalib/objects/namedobject.cpp
index 4424f3949a0..e16b7c9c8fa 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/namedobject.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/namedobject.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "namedobject.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/objects/nboserializer.cpp b/staging_vespalib/src/vespa/vespalib/objects/nboserializer.cpp
index 38dca76a0cd..ad3d1c4bf06 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/nboserializer.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/nboserializer.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "nboserializer.h"
#include <vespa/vespalib/objects/nbostream.h>
diff --git a/staging_vespalib/src/vespa/vespalib/objects/objectdumper.cpp b/staging_vespalib/src/vespa/vespalib/objects/objectdumper.cpp
index a80c69fd800..396c0214a9b 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/objectdumper.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/objectdumper.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "objectdumper.h"
#include <vespa/vespalib/util/stringfmt.h>
diff --git a/staging_vespalib/src/vespa/vespalib/objects/objectoperation.cpp b/staging_vespalib/src/vespa/vespalib/objects/objectoperation.cpp
index 016a8f7832f..9043c082af3 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/objectoperation.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/objectoperation.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "objectoperation.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/objects/objectpredicate.cpp b/staging_vespalib/src/vespa/vespalib/objects/objectpredicate.cpp
index 282f5550585..57c783f6410 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/objectpredicate.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/objectpredicate.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "objectpredicate.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/objects/objectvisitor.cpp b/staging_vespalib/src/vespa/vespalib/objects/objectvisitor.cpp
index d025a596a08..e1b547feefd 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/objectvisitor.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/objectvisitor.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "objectvisitor.h"
#include "identifiable.h"
diff --git a/staging_vespalib/src/vespa/vespalib/objects/serializer.cpp b/staging_vespalib/src/vespa/vespalib/objects/serializer.cpp
index 4583423eed6..2ca5e0ed271 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/serializer.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/serializer.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "serializer.h"
#include "identifiable.h"
diff --git a/staging_vespalib/src/vespa/vespalib/objects/valuetype.cpp b/staging_vespalib/src/vespa/vespalib/objects/valuetype.cpp
index ec7cf3132b9..3ad0ed164b4 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/valuetype.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/valuetype.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "valuetype.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/objects/visit.cpp b/staging_vespalib/src/vespa/vespalib/objects/visit.cpp
index fc266d5130d..b51104a45cc 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/visit.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/visit.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "visit.hpp"
void visit(vespalib::ObjectVisitor &self, const vespalib::string &name, const vespalib::Identifiable *obj) {
diff --git a/staging_vespalib/src/vespa/vespalib/util/CMakeLists.txt b/staging_vespalib/src/vespa/vespalib/util/CMakeLists.txt
index 43ef7a416d9..fd2c12abbd0 100644
--- a/staging_vespalib/src/vespa/vespalib/util/CMakeLists.txt
+++ b/staging_vespalib/src/vespa/vespalib/util/CMakeLists.txt
@@ -3,7 +3,6 @@ vespa_add_library(staging_vespalib_vespalib_util OBJECT
SOURCES
bits.cpp
clock.cpp
- cpu.cpp
crc.cpp
doom.cpp
growablebytebuffer.cpp
diff --git a/staging_vespalib/src/vespa/vespalib/util/bits.cpp b/staging_vespalib/src/vespa/vespalib/util/bits.cpp
index c60a17ae72d..f0e1bb4d4c5 100644
--- a/staging_vespalib/src/vespa/vespalib/util/bits.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/bits.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include <vespa/vespalib/util/bits.h>
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/util/bits.h b/staging_vespalib/src/vespa/vespalib/util/bits.h
index 18c5325dc3d..cca2ce68fa4 100644
--- a/staging_vespalib/src/vespa/vespalib/util/bits.h
+++ b/staging_vespalib/src/vespa/vespalib/util/bits.h
@@ -1,7 +1,8 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <stdint.h>
+#include <cstdint>
+#include <sys/types.h>
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/util/cpu.cpp b/staging_vespalib/src/vespa/vespalib/util/cpu.cpp
deleted file mode 100644
index 2a65f6ea2ad..00000000000
--- a/staging_vespalib/src/vespa/vespalib/util/cpu.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/vespalib/util/cpu.h>
-
-namespace vespalib {
-
-#if defined(__i386__) || defined(__x86_64)
-
-X86CpuInfo::CpuFeature X86CpuInfo::_CpuFeatureList[64] =
-{
- { 0, "FPU", "Floating-point unit on-Chip", "The processor contains an FPU that supports the Intel387 floating-point instruction set." },
- { 1, "VME", "Virtual Mode Extension", "The processor supports extensions to virtual-8086 mode." },
- { 2, "DE", "Debugging Extension", "The processor supports I/O breakpoints, including the CR4.DE bit for enabling debug extensions and optional trapping of access to the DR4 and DR5 registers." },
- { 3, "PSE", "Page Size Extension", "The processor supports 4-Mbyte pages." },
- { 4, "TSC", "Time Stamp Counter", "The RDTSC instruction is supported including the CR4.TSD bit for access/privilege control." },
- { 5, "MSR", "Model Specific Registers", "Model Specific Registers are implemented with the RDMSR, WRMSR instructions." },
- { 6, "PAE", "Physical Address Extension", "Physical addresses greater than 32 bits are supported." },
- { 7, "MCE", "Machine Check Exception", "Machine Check Exception, Exception 18, and the CR4.MCE enable bit are supported" },
- { 8, "CX8", "CMPXCHG8 Instruction Supported", "The compare and exchange 8 bytes instruction is supported." },
- { 9, "APIC", "On-chip APIC Hardware Supported", "The processor contains a software-accessible Local APIC." },
- { 10, "RES", "Reserved", "Do not count on their value." },
- { 11, "SEP", "Fast System Call", "Indicates whether the processor supports the Fast System Call instructions, SYSENTER and SYSEXIT. NOTE: Refer to Section 3.4 for further information regarding SYSENTER/ SYSEXIT feature and SEP feature bit." },
- { 12, "MTRR", "Memory Type Range Registers", "The Processor supports the Memory Type Range Registers specifically the MTRR_CAP register." },
- { 13, "PGE", "Page Global Enable", "The global bit in the page directory entries (PDEs) and page table entries (PTEs) is supported, indicating TLB entries that are common to different processes and need not be flushed. The CR4.PGE bit controls this feature." },
- { 14, "MCA", "Machine Check Architecture", "The Machine Check Architecture is supported, specifically the MCG_CAP register." },
- { 15, "CMOV", "Conditional Move Instruction Supported", "The processor supports CMOVcc, and if the FPU feature flag (bit 0) is also set, supports the FCMOVCC and FCOMI instructions." },
- { 16, "PAT", "Page Attribute Table", "Indicates whether the processor supports the Page Attribute Table. This feature augments the Memory Type Range Registers (MTRRs), allowing an operating system to specify attributes of memory on 4K granularity through a linear address." },
- { 17, "PSE-36", "36-bit Page Size Extension", "Indicates whether the processor supports 4-Mbyte pages that are capable of addressing physical memory beyond 4GB. This feature indicates that the upper four bits of the physical address of the 4-Mbyte page is encoded by bits 13-16 of the page directory entry." },
- { 18, "PSN", "Processor serial number is present and enabled", "The processor supports the 96-bit processor serial number feature, and the feature is enabled." },
- { 19, "CLFSH", "CLFLUSH Instruction supported", "Indicates that the processor supports the CLFLUSH instruction." },
- { 20, "RES", "Reserved", "Do not count on their value." },
- { 21, "DS", "Debug Store", "Indicates that the processor has the ability to write a history of the branch to and from addresses into a memory buffer." },
- { 22, "ACPI", "Thermal Monitor and Software Controlled Clock Facilities supported", "The processor implements internal MSRs that allow processor temperature to be monitored and processor performance to be modulated in predefined duty cycles under software control." },
- { 23, "MMX", "Intel Architecture MMX technology supported", "The processor supports the MMX technology instruction set extensions to Intel Architecture." },
- { 24, "FXSR", "Fast floating point save and restore", "Indicates whether the processor supports the FXSAVE and FXRSTOR instructions for fast save and restore of the floating point context. Presence of this bit also indicates that CR4.OSFXSR is available for an operating system to indicate that it uses the fast save/restore instructions." },
- { 25, "SSE", "Streaming SIMD Extensions supported", "The processor supports the Streaming SIMD Extensions to the Intel Architecture." },
- { 26, "SSE2", "Streaming SIMD Extensions 2", "Indicates the processor supports the Streaming SIMD Extensions - 2 Instructions." },
- { 27, "SS", "Self-Snoop", "The processor supports the management of conflicting memory types by performing a snoop of its own cache structure for transactions issued to the bus." },
- { 28, "HTT", "Hyper-Threading Technology", "The processor supports Hyper-Threading Technology." },
- { 29, "TM", "Thermal Monitor supported", "The processor implements the Thermal Monitor automatic thermal control circuit (TCC)." },
- { 30, "IA64", "IA64 Capabilities", "The processor is a member of the Intel Itanium processor family and currently operating in IA32 emulation mode." },
- { 31, "PBE", "Pending Break Enable", "The processor supports the use of the FERR#/PBE# pin when th eprocessor is in the stop-clock state(STPCLK# is asserted) to signal the processor that an interrupt is pending and that the processor should return to normal operation to handle the interrupt. Bit 10 (PBE enable) in the IA32_MISc_ENABLE MSR enables this capability." },
-
- { 32, "SSE3", "Streaming SIMD Extensions 3", "The processor supports the Streaming SIMD Extensions 3 instructions." },
- { 33, "RES", "Reserved", "Do not count on their value." },
- { 34, "DTES64", "64-Bit Debug Store", "Indicates that the processor has the ability to write a history of the 64-bit branch to and from addresses into a memory buffer." },
- { 35, "MONITOR", "MONITOR/MWAIT", "The processor supports the MONITOR and MWAIT instructions." },
- { 36, "DS-CPL", "CPL Qualified Debug Store", "The processor supports the extensions to the Debug Store feature to allow for branch message storage qualified by CPL." },
- { 37, "VMX", "Virtual Machine Extensions", "The processor supports Intel Virtualization Technology." },
- { 38, "SMX", "Safer Mode Extensions", "The processor supports Intel Trusted Execution Technology." },
- { 39, "EST", "Enhanced Intel SpeedStep", "The processor supports Enhanced Intel SpeedStep Technology and implements the IA32_PERF_STS and IA32_PERF_CTL registers." },
- { 40, "TM2", "Thermal Monitor 2", "The processor implements the Thermal Monitor 2 thermal control circuit (TCC)." },
- { 41, "SSSE3", "Supplemental Streaming SIMD Extensions 3", "The processor supports the Supplemental Streaming SIMD Extensions 3 instructions." },
- { 42, "CID", "L1 Context ID", "The L1 data cache mode can be set to either adaptive mode or shared mode by the BIOS." },
- { 43, "RES", "Reserved", "Do not count on their value." },
- { 44, "RES", "Reserved", "Do not count on their value." },
- { 45, "CX16", "CMPXCHG16B", "This processor supports the CMPXCHG16B instruction." },
- { 46, "xTPR", "Send Task Priority Messages", "The processor supports the ability to disable sending Task Priority messages. When this feature flag is set, Task Priority messages may be disabled. Bit 23 (Echo TPR disable) in the IA32_MISC_ENABLE MSR controls the sending of Task Priority messages." },
- { 47, "PDCM", "Perfmon and Debug Capability", "The processor supports the Performance Capabilities MSR. IA32_PERF_CAPABILITIES register is MSR 345h." },
- { 48, "RES", "Reserved", "Do not count on their value." },
- { 49, "RES", "Reserved", "Do not count on their value." },
- { 50, "DCA", "Direct Cache Access", "The processor supports the ability to prefetch data from a memory mapped device." },
- { 51, "SSS4.1", "Streaming SIMD Extensions 4.1", "The processor supports the Streaming SIMD Extensions 4.1 instructions." },
- { 52, "SSE4.2", "Streaming SIMD Extensions 4.2", "The processor supports the Streaming SIMD Extensions 4.2 instructions." },
- { 53, "x2APIC", "Extended xAPIC Support", "The processor supports x2APIC feature." },
- { 54, "MOVBE", "MOVBE Instruction", "The processor supports MOVBE instruction." },
- { 55, "POPCNT", "POPCNT Instruction", "The processor supports the POPCNT instruction." },
- { 56, "RES", "Reserved", "Do not count on their value." },
- { 57, "RES", "Reserved", "Do not count on their value." },
- { 58, "XSAVE", "XSAVE/XSTOR States", "The processor supports the XSAVE/XRSTOR processor extended states feature, the XSETBV/ XGETBV instructions, and the XFEATURE_ENABLED_MASK register (XCR0)." },
- { 59, "OXSAVE", "OS Enabled XSAVE", "A value of 1 indicates that the OS has enabled XSETBV/XGETBV instructions to access the XFEATURE_ENABLED_MASK register (XCR0), and support for processor extended state management using XSAVE/XRSTOR." },
- { 60, "RES", "Reserved", "Do not count on their value." },
- { 61, "RES", "Reserved", "Do not count on their value." },
- { 62, "RES", "Reserved", "Do not count on their value." },
- { 63, "RES", "Reserved", "Do not count on their value." }
-
-};
-
-// private empty constructor
-X86CpuInfo::X86CpuInfo()
-{
- memset(this, 0, sizeof(*this));
-}
-
-X86CpuInfo X86CpuInfo::_CpuInfoSingleton;
-X86CpuInfo* X86CpuInfo::_CpuInfoSingletonPtr = 0;
-
-void X86CpuInfo::fillSingleton()
-{
- X86CpuInfo tmp;
-
- uint32_t b, c, d;
- Cpu::cpuid(0, tmp.largestStandardFunction, b, c, d);
- memcpy(tmp.cpuName+0, &b, 4);
- memcpy(tmp.cpuName+4, &d, 4);
- memcpy(tmp.cpuName+8, &c, 4);
-
- Cpu::cpuid(1, tmp.versionInfo, tmp.apicInfo, tmp.extendedFeatures, tmp.mainFeatures);
- uint64_t cf = tmp.extendedFeatures;
- cf = (cf << 32) | tmp.mainFeatures;
- tmp._cpuFeatures = cf;
-
- // add more cpuid extraction here
-
- _CpuInfoSingleton = tmp;
-}
-
-void X86CpuInfo::print(FILE * fp)
-{
- uint32_t stepping = (cpuInfo().versionInfo & 0xF);
- uint32_t baseModel = (cpuInfo().versionInfo >> 4) & 0xF;
- uint32_t baseFamily = (cpuInfo().versionInfo >> 8) & 0xF;
- uint32_t extModel = (cpuInfo().versionInfo >> 16) & 0xF;
- uint32_t extFamily = (cpuInfo().versionInfo >> 20) & 0xFF;
-
- fprintf(fp, "cpuFeatures=%0x, cpuExtendedFeatures=%0x, family %d/%d, model %d/%d, stepping=%d\n\n",
- cpuInfo().mainFeatures, cpuInfo().extendedFeatures,
- baseFamily, extFamily, baseModel, extModel, stepping);
-
- fprintf(fp, "largestStandardFunction=%d, cpuName=%s\n",
- cpuInfo().largestStandardFunction, cpuInfo().cpuName);
-
- uint64_t cpuFeatures = cpuInfo()._cpuFeatures;
- for (unsigned int i = 0; i < sizeof(_CpuFeatureList)/sizeof(_CpuFeatureList[0]); i++) {
- const CpuFeature & f = _CpuFeatureList[i];
- if ((cpuFeatures >> i ) & 1) {
- fprintf(fp, "Feature #%d = %s\t%s\n\t%s\n", i, f.Name, f.Description, f.Comment);
- }
- }
-}
-
-
-#endif
-
-}
-
-#if 0
-int main(int, char **)
-{
- vespalib::X86CpuInfo::print(stdout);
-}
-#endif
diff --git a/staging_vespalib/src/vespa/vespalib/util/cpu.h b/staging_vespalib/src/vespa/vespalib/util/cpu.h
deleted file mode 100644
index 719bf0d8a98..00000000000
--- a/staging_vespalib/src/vespa/vespalib/util/cpu.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-// Copyright (C) 2003 Fast Search & Transfer ASA
-// Copyright (C) 2003 Overture Services Norway AS
-
-#pragma once
-
-
-namespace vespalib {
-
-#if defined(__i386__) || defined(__x86_64__)
-class X86CpuInfo
-{
-public:
- bool hasMMX() const { return hasFeature(23); }
- bool hasSSE() const { return hasFeature(25); }
- bool hasSSE2() const { return hasFeature(26); }
- bool hasSSE3() const { return hasFeature(32); }
- bool hasCX16() const { return hasFeature(45); }
-
- bool hasFeature(size_t i) const { return (_cpuFeatures >> i) & 1; }
- bool hasFeature(const char *name) const;
- static void print(FILE * fp);
-
- /**
- * Use this accessor to get information about the CPU.
- * Only the first access will actually extract data, all
- * subsequent uses are very cheap.
- **/
- static const X86CpuInfo& cpuInfo() {
- if (_CpuInfoSingletonPtr == 0) {
- fillSingleton();
- _CpuInfoSingletonPtr = &_CpuInfoSingleton;
- }
- return *_CpuInfoSingletonPtr;
- }
-
-private:
- struct CpuFeature
- {
- size_t BitNo;
- const char *Name;
- const char *Description;
- const char *Comment;
- };
- static CpuFeature _CpuFeatureList[];
-
- static X86CpuInfo _CpuInfoSingleton;
- static X86CpuInfo *_CpuInfoSingletonPtr;
- static void fillSingleton();
-
- // no outside construction allowed:
- X86CpuInfo();
-
- uint64_t _cpuFeatures;
-
-public:
- // public data extracted from CPU
- uint32_t mainFeatures;
- uint32_t extendedFeatures;
- uint32_t apicInfo; // brand, CLFLUSH line size, logical / physical, local apic ID
- uint32_t versionInfo; // family, model, stepping
-
- // add more info later:
- // uint32_t numCpuInfo;
-
- char cpuName[13];
- uint32_t largestStandardFunction;
-
-};
-#endif
-
-/**
- * @brief Atomic instructions class
- *
- * Here are fast handcoded assembly functions for doing some special
- * low level functions that can be carried out very fast by special instructions.
- * Currently only implemented for GCC on i386 and x86_64 platforms.
- **/
-class Cpu
-{
-public:
-#if defined(__x86_64__)
- static void cpuid(int op, uint32_t & eax, uint32_t & ebx, uint32_t & ecx, uint32_t & edx) {
- __asm__("cpuid"
- : "=a" (eax),
- "=b" (ebx),
- "=c" (ecx),
- "=d" (edx)
- : "0" (op));
- }
-#endif
-};
-
-}
-
diff --git a/staging_vespalib/src/vespa/vespalib/util/crc.cpp b/staging_vespalib/src/vespa/vespalib/util/crc.cpp
index 88a27f71c7e..f234ef093c2 100644
--- a/staging_vespalib/src/vespa/vespalib/util/crc.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/crc.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include <vespa/vespalib/util/crc.h>
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp b/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp
index 1b20b044363..7c581c89af0 100644
--- a/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp
@@ -1,7 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/vespalib/util/document_runnable.h>
+#include "document_runnable.h"
#include <vespa/vespalib/util/exceptions.h>
namespace document {
diff --git a/staging_vespalib/src/vespa/vespalib/util/doom.cpp b/staging_vespalib/src/vespa/vespalib/util/doom.cpp
index 801e71b2e7e..2ee2134c71e 100644
--- a/staging_vespalib/src/vespa/vespalib/util/doom.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/doom.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "doom.h"
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.cpp b/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.cpp
index abd5e7a2b5b..537b44c49eb 100644
--- a/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/growablebytebuffer.cpp
@@ -1,5 +1,4 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include <vespa/vespalib/util/growablebytebuffer.h>
using namespace vespalib;
diff --git a/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.cpp b/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.cpp
index 3adeaf5c33d..27b219a435c 100644
--- a/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "process_memory_stats.h"
#include <fstream>
#include <sstream>
diff --git a/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.h b/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.h
index d679f29c0af..f35636c2855 100644
--- a/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.h
+++ b/staging_vespalib/src/vespa/vespalib/util/process_memory_stats.h
@@ -2,8 +2,9 @@
#pragma once
-namespace vespalib
-{
+#include <cstdint>
+
+namespace vespalib {
/*
* Class for linux specific way to get memory stats for current process.
diff --git a/staging_vespalib/src/vespa/vespalib/util/programoptions.cpp b/staging_vespalib/src/vespa/vespalib/util/programoptions.cpp
index cda2f6409b9..356d86a1dee 100644
--- a/staging_vespalib/src/vespa/vespalib/util/programoptions.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/programoptions.cpp
@@ -1,12 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include <vespa/vespalib/util/programoptions.h>
#include <iostream>
-#include <vespa/log/log.h>
#include <vespa/vespalib/util/exceptions.h>
#include <boost/lexical_cast.hpp>
+#include <vespa/log/log.h>
LOG_SETUP(".programoptions");
namespace vespalib {
diff --git a/staging_vespalib/src/vespa/vespalib/util/rusage.cpp b/staging_vespalib/src/vespa/vespalib/util/rusage.cpp
index 084cec7cca0..a3a850286ce 100644
--- a/staging_vespalib/src/vespa/vespalib/util/rusage.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/rusage.cpp
@@ -1,8 +1,7 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "rusage.h"
#include <stdexcept>
-#include <vespa/vespalib/util/vstringfmt.h>
+#include <vespa/vespalib/util/stringfmt.h>
namespace vespalib {
@@ -45,7 +44,7 @@ RUsage RUsage::createSelf(const fastos::TimeStamp & since)
RUsage r;
r._time = fastos::TimeStamp(fastos::ClockSystem::now()) - since;
if (getrusage(RUSAGE_SELF, &r) != 0) {
- throw std::runtime_error(vespalib::make_vespa_string("getrusage failed with errno = %d", errno).c_str());
+ throw std::runtime_error(vespalib::make_string("getrusage failed with errno = %d", errno).c_str());
}
return r;
}
@@ -55,7 +54,7 @@ RUsage RUsage::createChildren(const fastos::TimeStamp & since)
RUsage r;
r._time = fastos::TimeStamp(fastos::ClockSystem::now()) - since;
if (getrusage(RUSAGE_CHILDREN, &r) != 0) {
- throw std::runtime_error(vespalib::make_vespa_string("getrusage failed with errno = %d", errno).c_str());
+ throw std::runtime_error(vespalib::make_string("getrusage failed with errno = %d", errno).c_str());
}
return r;
}
@@ -63,23 +62,23 @@ RUsage RUsage::createChildren(const fastos::TimeStamp & since)
vespalib::string RUsage::toString()
{
vespalib::string s;
- if (_time.sec() != 0.0) s += make_vespa_string("duration = %1.6f\n", _time.sec());
- if (fastos::TimeStamp(ru_utime).sec() != 0.0) s += make_vespa_string("user time = %1.6f\n", fastos::TimeStamp(ru_utime).sec());
- if (fastos::TimeStamp(ru_stime).sec() != 0.0) s += make_vespa_string("system time = %1.6f\n", fastos::TimeStamp(ru_stime).sec());
- if (ru_maxrss != 0) s += make_vespa_string("ru_maxrss = %ld\n", ru_maxrss);
- if (ru_ixrss != 0) s += make_vespa_string("ru_ixrss = %ld\n", ru_ixrss);
- if (ru_idrss != 0) s += make_vespa_string("ru_idrss = %ld\n", ru_idrss);
- if (ru_isrss != 0) s += make_vespa_string("ru_isrss = %ld\n", ru_isrss);
- if (ru_minflt != 0) s += make_vespa_string("ru_minflt = %ld\n", ru_minflt);
- if (ru_majflt != 0) s += make_vespa_string("ru_majflt = %ld\n", ru_majflt);
- if (ru_nswap != 0) s += make_vespa_string("ru_nswap = %ld\n", ru_nswap);
- if (ru_inblock != 0) s += make_vespa_string("ru_inblock = %ld\n", ru_inblock);
- if (ru_oublock != 0) s += make_vespa_string("ru_oublock = %ld\n", ru_oublock);
- if (ru_msgsnd != 0) s += make_vespa_string("ru_msgsnd = %ld\n", ru_msgsnd);
- if (ru_msgrcv != 0) s += make_vespa_string("ru_msgrcv = %ld\n", ru_msgrcv);
- if (ru_nsignals != 0) s += make_vespa_string("ru_nsignals = %ld\n", ru_nsignals);
- if (ru_nvcsw != 0) s += make_vespa_string("ru_nvcsw = %ld\n", ru_nvcsw);
- if (ru_nivcsw != 0) s += make_vespa_string("ru_nivcsw = %ld", ru_nivcsw);
+ if (_time.sec() != 0.0) s += make_string("duration = %1.6f\n", _time.sec());
+ if (fastos::TimeStamp(ru_utime).sec() != 0.0) s += make_string("user time = %1.6f\n", fastos::TimeStamp(ru_utime).sec());
+ if (fastos::TimeStamp(ru_stime).sec() != 0.0) s += make_string("system time = %1.6f\n", fastos::TimeStamp(ru_stime).sec());
+ if (ru_maxrss != 0) s += make_string("ru_maxrss = %ld\n", ru_maxrss);
+ if (ru_ixrss != 0) s += make_string("ru_ixrss = %ld\n", ru_ixrss);
+ if (ru_idrss != 0) s += make_string("ru_idrss = %ld\n", ru_idrss);
+ if (ru_isrss != 0) s += make_string("ru_isrss = %ld\n", ru_isrss);
+ if (ru_minflt != 0) s += make_string("ru_minflt = %ld\n", ru_minflt);
+ if (ru_majflt != 0) s += make_string("ru_majflt = %ld\n", ru_majflt);
+ if (ru_nswap != 0) s += make_string("ru_nswap = %ld\n", ru_nswap);
+ if (ru_inblock != 0) s += make_string("ru_inblock = %ld\n", ru_inblock);
+ if (ru_oublock != 0) s += make_string("ru_oublock = %ld\n", ru_oublock);
+ if (ru_msgsnd != 0) s += make_string("ru_msgsnd = %ld\n", ru_msgsnd);
+ if (ru_msgrcv != 0) s += make_string("ru_msgrcv = %ld\n", ru_msgrcv);
+ if (ru_nsignals != 0) s += make_string("ru_nsignals = %ld\n", ru_nsignals);
+ if (ru_nvcsw != 0) s += make_string("ru_nvcsw = %ld\n", ru_nvcsw);
+ if (ru_nivcsw != 0) s += make_string("ru_nivcsw = %ld", ru_nivcsw);
return s;
}
diff --git a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp
index d0d6667556f..0babb606dd9 100644
--- a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.cpp
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "shutdownguard.h"
+
#include <vespa/log/log.h>
LOG_SETUP(".vespalib.shutdownguard");
diff --git a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h
index b2a5ef3f27e..50f5695902a 100644
--- a/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h
+++ b/staging_vespalib/src/vespa/vespalib/util/shutdownguard.h
@@ -1,6 +1,7 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
+#include <vespa/fastos/thread.h>
namespace vespalib {