Lines Matching refs:string
19 #include <string.h>
26 #include <string>
58 std::unique_ptr<FtraceProcfs> FtraceProcfs::Create(const std::string& root) {
65 FtraceProcfs::FtraceProcfs(const std::string& root) : root_(root) {}
68 bool FtraceProcfs::EnableEvent(const std::string& group,
69 const std::string& name) {
70 std::string path = root_ + "events/" + group + "/" + name + "/enable";
74 bool FtraceProcfs::DisableEvent(const std::string& group,
75 const std::string& name) {
76 std::string path = root_ + "events/" + group + "/" + name + "/enable";
81 std::string path = root_ + "events/enable";
85 std::string FtraceProcfs::ReadEventFormat(const std::string& group,
86 const std::string& name) const {
87 std::string path = root_ + "events/" + group + "/" + name + "/format";
91 std::string FtraceProcfs::ReadCpuStats(size_t cpu) const {
92 std::string path = root_ + "per_cpu/cpu" + std::to_string(cpu) + "/stats";
102 std::string path = root_ + "trace";
106 bool FtraceProcfs::WriteTraceMarker(const std::string& str) {
107 std::string path = root_ + "trace_marker";
116 std::string path = root_ + "buffer_size_kb";
122 std::string path = root_ + "tracing_on";
128 std::string path = root_ + "tracing_on";
137 std::string path = root_ + "tracing_on";
141 bool FtraceProcfs::SetClock(const std::string& clock_name) {
142 std::string path = root_ + "trace_clock";
146 std::string FtraceProcfs::GetClock() {
147 std::string path = root_ + "trace_clock";
148 std::string s = ReadFileIntoString(path);
151 if (start == std::string::npos)
155 if (end == std::string::npos)
161 std::set<std::string> FtraceProcfs::AvailableClocks() {
162 std::string path = root_ + "trace_clock";
163 std::string s = ReadFileIntoString(path);
164 std::set<std::string> names;
171 if (end == std::string::npos)
176 std::string name = s.substr(start, end - start);
192 bool FtraceProcfs::WriteNumberToFile(const std::string& path, size_t value) {
198 return WriteToFile(path, std::string(buf));
201 bool FtraceProcfs::WriteToFile(const std::string& path,
202 const std::string& str) {
214 std::string path =
219 char FtraceProcfs::ReadOneCharFromFile(const std::string& path) {
228 bool FtraceProcfs::ClearFile(const std::string& path) {
233 std::string FtraceProcfs::ReadFileIntoString(const std::string& path) const {
236 std::string str;
244 bool FtraceProcfs::CheckRootPath(const std::string& root) {