summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-hung Hsieh <chh@google.com>2016-07-12 20:48:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-07-12 20:48:58 +0000
commitee87476e38cd66ac82c7ca858085b3897a816d96 (patch)
treec67f65ff0a896f559d57e913b92a47bd7868a8f4
parentaca55610170be7213616dfed9776fb392e0fdd2f (diff)
parent5674ed87431f2d9b05f4ec0c7f7c2e56e585c956 (diff)
downloadextras-ee87476e38cd66ac82c7ca858085b3897a816d96.tar.gz
Merge "Fix google-explicit-constructor warnings in simpleperf."
-rw-r--r--simpleperf/cmd_report_sample.cpp4
-rw-r--r--simpleperf/cmd_stat.cpp2
-rw-r--r--simpleperf/perf_regs.h2
-rw-r--r--simpleperf/record.h18
-rw-r--r--simpleperf/sample_tree.h6
-rw-r--r--simpleperf/sample_tree_test.cpp2
-rw-r--r--simpleperf/tracing.h2
-rw-r--r--simpleperf/utils.h4
-rw-r--r--simpleperf/workload.h2
9 files changed, 21 insertions, 21 deletions
diff --git a/simpleperf/cmd_report_sample.cpp b/simpleperf/cmd_report_sample.cpp
index b254e82c..11fd363a 100644
--- a/simpleperf/cmd_report_sample.cpp
+++ b/simpleperf/cmd_report_sample.cpp
@@ -34,7 +34,7 @@ namespace {
class ProtobufFileWriter : public google::protobuf::io::CopyingOutputStream {
public:
- ProtobufFileWriter(FILE* out_fp) : out_fp_(out_fp) {}
+ explicit ProtobufFileWriter(FILE* out_fp) : out_fp_(out_fp) {}
bool Write(const void* buffer, int size) override {
return fwrite(buffer, size, 1, out_fp_) == 1;
@@ -46,7 +46,7 @@ class ProtobufFileWriter : public google::protobuf::io::CopyingOutputStream {
class ProtobufFileReader : public google::protobuf::io::CopyingInputStream {
public:
- ProtobufFileReader(FILE* in_fp) : in_fp_(in_fp) {}
+ explicit ProtobufFileReader(FILE* in_fp) : in_fp_(in_fp) {}
int Read(void* buffer, int size) override {
return fread(buffer, 1, size, in_fp_);
diff --git a/simpleperf/cmd_stat.cpp b/simpleperf/cmd_stat.cpp
index 5867abc1..59626af3 100644
--- a/simpleperf/cmd_stat.cpp
+++ b/simpleperf/cmd_stat.cpp
@@ -124,7 +124,7 @@ struct CounterSummary {
class CounterSummaries {
public:
- CounterSummaries(bool csv): csv_(csv) {}
+ explicit CounterSummaries(bool csv): csv_(csv) {}
void AddSummary(const CounterSummary& summary) {
summaries_.push_back(summary);
}
diff --git a/simpleperf/perf_regs.h b/simpleperf/perf_regs.h
index 7705e50f..98b7810b 100644
--- a/simpleperf/perf_regs.h
+++ b/simpleperf/perf_regs.h
@@ -64,7 +64,7 @@ std::string GetRegName(size_t regno, ArchType arch);
class ScopedCurrentArch {
public:
- ScopedCurrentArch(ArchType arch) : saved_arch(current_arch) {
+ explicit ScopedCurrentArch(ArchType arch) : saved_arch(current_arch) {
current_arch = arch;
}
~ScopedCurrentArch() {
diff --git a/simpleperf/record.h b/simpleperf/record.h
index 8929ee5a..78ae958b 100644
--- a/simpleperf/record.h
+++ b/simpleperf/record.h
@@ -134,7 +134,7 @@ struct RecordHeader {
RecordHeader() : type(0), misc(0), size(0) {}
- RecordHeader(const char* p) {
+ explicit RecordHeader(const char* p) {
auto pheader = reinterpret_cast<const perf_event_header*>(p);
if (pheader->type < SIMPLE_PERF_RECORD_TYPE_START) {
type = pheader->type;
@@ -208,7 +208,7 @@ struct Record {
SampleId sample_id;
Record() {}
- Record(const char* p) : header(p) {}
+ explicit Record(const char* p) : header(p) {}
virtual ~Record() {}
@@ -389,7 +389,7 @@ struct BuildIdRecord : public Record {
BuildIdRecord() {}
- BuildIdRecord(const char* p);
+ explicit BuildIdRecord(const char* p);
std::vector<char> BinaryFormat() const override;
static BuildIdRecord Create(bool in_kernel, pid_t pid,
@@ -405,7 +405,7 @@ struct KernelSymbolRecord : public Record {
KernelSymbolRecord() {}
- KernelSymbolRecord(const char* p);
+ explicit KernelSymbolRecord(const char* p);
std::vector<char> BinaryFormat() const override;
static KernelSymbolRecord Create(std::string kallsyms);
@@ -422,7 +422,7 @@ struct DsoRecord : public Record {
DsoRecord() {}
- DsoRecord(const char* p);
+ explicit DsoRecord(const char* p);
std::vector<char> BinaryFormat() const override;
static DsoRecord Create(uint64_t dso_type, uint64_t dso_id,
@@ -440,7 +440,7 @@ struct SymbolRecord : public Record {
SymbolRecord() {}
- SymbolRecord(const char* p);
+ explicit SymbolRecord(const char* p);
std::vector<char> BinaryFormat() const override;
static SymbolRecord Create(uint64_t addr, uint64_t len,
@@ -455,7 +455,7 @@ struct TracingDataRecord : public Record {
TracingDataRecord() {}
- TracingDataRecord(const char* p);
+ explicit TracingDataRecord(const char* p);
std::vector<char> BinaryFormat() const override;
static TracingDataRecord Create(std::vector<char> tracing_data);
@@ -469,7 +469,7 @@ struct TracingDataRecord : public Record {
struct UnknownRecord : public Record {
std::vector<char> data;
- UnknownRecord(const char* p);
+ explicit UnknownRecord(const char* p);
std::vector<char> BinaryFormat() const override;
protected:
@@ -499,7 +499,7 @@ std::vector<std::unique_ptr<Record>> ReadRecordsFromBuffer(
// time (t - min_time_diff) or earlier.
class RecordCache {
public:
- RecordCache(bool has_timestamp, size_t min_cache_size = 1000u,
+ explicit RecordCache(bool has_timestamp, size_t min_cache_size = 1000u,
uint64_t min_time_diff_in_ns = 1000000u);
~RecordCache();
void Push(std::unique_ptr<Record> record);
diff --git a/simpleperf/sample_tree.h b/simpleperf/sample_tree.h
index eb4e38ae..3dde334d 100644
--- a/simpleperf/sample_tree.h
+++ b/simpleperf/sample_tree.h
@@ -51,7 +51,7 @@
template <typename EntryT, typename AccumulateInfoT>
class SampleTreeBuilder {
public:
- SampleTreeBuilder(SampleComparator<EntryT> comparator)
+ explicit SampleTreeBuilder(SampleComparator<EntryT> comparator)
: sample_set_(comparator),
accumulate_callchain_(false),
sample_comparator_(comparator),
@@ -272,7 +272,7 @@ class SampleTreeBuilder {
template <typename EntryT>
class SampleTreeSorter {
public:
- SampleTreeSorter(SampleComparator<EntryT> comparator)
+ explicit SampleTreeSorter(SampleComparator<EntryT> comparator)
: comparator_(comparator) {}
virtual ~SampleTreeSorter() {}
@@ -300,7 +300,7 @@ class SampleTreeSorter {
template <typename EntryT, typename InfoT>
class SampleTreeDisplayer {
public:
- SampleTreeDisplayer(SampleDisplayer<EntryT, InfoT> displayer)
+ explicit SampleTreeDisplayer(SampleDisplayer<EntryT, InfoT> displayer)
: displayer_(displayer) {}
virtual ~SampleTreeDisplayer() {}
diff --git a/simpleperf/sample_tree_test.cpp b/simpleperf/sample_tree_test.cpp
index a3c7811f..e2889688 100644
--- a/simpleperf/sample_tree_test.cpp
+++ b/simpleperf/sample_tree_test.cpp
@@ -58,7 +58,7 @@ class TestSampleComparator : public SampleComparator<SampleEntry> {
class TestSampleTreeBuilder : public SampleTreeBuilder<SampleEntry, int> {
public:
- TestSampleTreeBuilder(ThreadTree* thread_tree)
+ explicit TestSampleTreeBuilder(ThreadTree* thread_tree)
: SampleTreeBuilder(TestSampleComparator()), thread_tree_(thread_tree) {}
void AddSample(int pid, int tid, uint64_t ip, bool in_kernel) {
diff --git a/simpleperf/tracing.h b/simpleperf/tracing.h
index 4e213982..e4c375be 100644
--- a/simpleperf/tracing.h
+++ b/simpleperf/tracing.h
@@ -70,7 +70,7 @@ class TracingFile;
class Tracing {
public:
- Tracing(const std::vector<char>& data);
+ explicit Tracing(const std::vector<char>& data);
~Tracing();
void Dump(size_t indent);
TracingFormat GetTracingFormatHavingId(uint64_t trace_event_id);
diff --git a/simpleperf/utils.h b/simpleperf/utils.h
index 9ab0f864..5c624bba 100644
--- a/simpleperf/utils.h
+++ b/simpleperf/utils.h
@@ -40,7 +40,7 @@ static inline uint64_t Align(uint64_t value, uint64_t alignment) {
// It reduces the cost to free each allocated memory.
class OneTimeFreeAllocator {
public:
- OneTimeFreeAllocator(size_t unit_size = 8192u)
+ explicit OneTimeFreeAllocator(size_t unit_size = 8192u)
: unit_size_(unit_size), cur_(nullptr), end_(nullptr) {
}
@@ -79,7 +79,7 @@ class FileHelper {
}
private:
- FileHelper(int fd) : fd_(fd) {}
+ explicit FileHelper(int fd) : fd_(fd) {}
int fd_;
DISALLOW_COPY_AND_ASSIGN(FileHelper);
diff --git a/simpleperf/workload.h b/simpleperf/workload.h
index 1407c767..fa754b5a 100644
--- a/simpleperf/workload.h
+++ b/simpleperf/workload.h
@@ -43,7 +43,7 @@ class Workload {
}
private:
- Workload(const std::vector<std::string>& args)
+ explicit Workload(const std::vector<std::string>& args)
: work_state_(NotYetCreateNewProcess),
args_(args),
work_pid_(-1),