Home
last modified time | relevance | path

Searched refs:s (Results 1 – 25 of 1077) sorted by relevance

12345678910>>...44

/system/extras/taskstats/
Dtaskstats.c135 const struct taskstats* s = &stats->stats; in print_task_stats() local
138 printf("%-25s%d\n", "Stats version:", s->version); in print_task_stats()
139 printf("%-25s%d\n", "Exit code:", s->ac_exitcode); in print_task_stats()
140 printf("%-25s0x%x\n", "Flags:", s->ac_flag); in print_task_stats()
141 printf("%-25s%d\n", "Nice value:", s->ac_nice); in print_task_stats()
142 printf("%-25s%s\n", "Command name:", s->ac_comm); in print_task_stats()
143 printf("%-25s%d\n", "Scheduling discipline:", s->ac_sched); in print_task_stats()
144 printf("%-25s%d\n", "UID:", s->ac_uid); in print_task_stats()
145 printf("%-25s%d\n", "GID:", s->ac_gid); in print_task_stats()
146 printf("%-25s%d\n", "PID:", s->ac_pid); in print_task_stats()
[all …]
/system/core/trusty/utils/rpmb_dev/
Drpmb_dev.c116 static int rpmb_file_seek(struct rpmb_dev_state* s, uint16_t addr) { in rpmb_file_seek() argument
118 int pos = addr * RPMB_PACKET_DATA_SIZE + sizeof(s->header); in rpmb_file_seek()
119 ret = lseek(s->data_fd, pos, SEEK_SET); in rpmb_file_seek()
127 static uint16_t rpmb_dev_program_key(struct rpmb_dev_state* s) { in rpmb_dev_program_key() argument
130 if (s->header.key_programmed) { in rpmb_dev_program_key()
134 s->header.key = s->cmd[0].key_mac; in rpmb_dev_program_key()
135 s->header.key_programmed = 1; in rpmb_dev_program_key()
137 ret = lseek(s->data_fd, 0, SEEK_SET); in rpmb_dev_program_key()
143 ret = write(s->data_fd, &s->header, sizeof(s->header)); in rpmb_dev_program_key()
144 if (ret != sizeof(s->header)) { in rpmb_dev_program_key()
[all …]
/system/extras/ioshark/
Dcompile_ioshark.c125 char *s, *s2; in get_tracetype() local
128 s = strchr(buf, ' '); in get_tracetype()
129 if (s == NULL) { in get_tracetype()
135 while (*s == ' ') in get_tracetype()
136 s++; in get_tracetype()
137 if (sscanf(s, "%s", trace_type) != 1) { in get_tracetype()
153 s2 = strchr(s, ' '); in get_tracetype()
172 bcopy(s2, s, strlen(s2) + 1); in get_tracetype()
178 char *s, *s2, save; in get_pathname() local
181 s = strchr(buf, '/'); in get_pathname()
[all …]
/system/core/libsparse/
Dsparse.cpp31 struct sparse_file* s = reinterpret_cast<sparse_file*>(calloc(sizeof(struct sparse_file), 1)); in sparse_file_new() local
32 if (!s) { in sparse_file_new()
36 s->backed_block_list = backed_block_list_new(block_size); in sparse_file_new()
37 if (!s->backed_block_list) { in sparse_file_new()
38 free(s); in sparse_file_new()
42 s->block_size = block_size; in sparse_file_new()
43 s->len = len; in sparse_file_new()
45 return s; in sparse_file_new()
48 void sparse_file_destroy(struct sparse_file* s) { in sparse_file_destroy() argument
49 backed_block_list_destroy(s->backed_block_list); in sparse_file_destroy()
[all …]
Dsparse_read.cpp73 virtual int AddToSparseFile(struct sparse_file* s, int64_t len, unsigned int block) = 0;
102 int AddToSparseFile(struct sparse_file* s, int64_t len, unsigned int block) override { in AddToSparseFile() argument
103 return sparse_file_add_fd(s, fd, GetOffset(), len, block); in AddToSparseFile()
167 int AddToSparseFile(struct sparse_file* s, int64_t len, unsigned int block) override { in AddToSparseFile() argument
172 return sparse_file_add_data(s, buf, len, block); in AddToSparseFile()
212 static int process_raw_chunk(struct sparse_file* s, unsigned int chunk_size, in process_raw_chunk() argument
216 int64_t len = (int64_t)blocks * s->block_size; in process_raw_chunk()
218 if (chunk_size % s->block_size != 0) { in process_raw_chunk()
222 if (chunk_size / s->block_size != blocks) { in process_raw_chunk()
226 ret = source->AddToSparseFile(s, len, block); in process_raw_chunk()
[all …]
/system/core/mkbootfs/
Dmkbootfs.c42 static void fix_stat(const char *path, struct stat *s) in fix_stat() argument
56 s->st_uid = p->uid; in fix_stat()
57 s->st_gid = p->gid; in fix_stat()
58 s->st_mode = p->mode | (s->st_mode & ~07777); in fix_stat()
62 s->st_uid = empty_path_config->uid; in fix_stat()
63 s->st_gid = empty_path_config->gid; in fix_stat()
64 s->st_mode = empty_path_config->mode | (s->st_mode & ~07777); in fix_stat()
67 unsigned st_mode = s->st_mode; in fix_stat()
68 int is_dir = S_ISDIR(s->st_mode) || strcmp(path, TRAILER) == 0; in fix_stat()
69 fs_config(path, is_dir, target_out_path, &s->st_uid, &s->st_gid, &st_mode, &capabilities); in fix_stat()
[all …]
/system/core/libcutils/
Dsocket_network_client_unix.cpp32 static int toggle_O_NONBLOCK(int s) { in toggle_O_NONBLOCK() argument
33 int flags = fcntl(s, F_GETFL); in toggle_O_NONBLOCK()
34 if (flags == -1 || fcntl(s, F_SETFL, flags ^ O_NONBLOCK) == -1) { in toggle_O_NONBLOCK()
35 close(s); in toggle_O_NONBLOCK()
38 return s; in toggle_O_NONBLOCK()
65 int s = socket(addr->ai_family, type, addr->ai_protocol); in socket_network_client_timeout() local
66 if (s == -1 || toggle_O_NONBLOCK(s) == -1) break; in socket_network_client_timeout()
68 int rc = connect(s, addr->ai_addr, addr->ai_addrlen); in socket_network_client_timeout()
70 result = toggle_O_NONBLOCK(s); in socket_network_client_timeout()
73 close(s); in socket_network_client_timeout()
[all …]
Dsocket_local_server_unix.cpp55 int socket_local_server_bind(int s, const char *name, int namespaceId) argument
80 setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n));
82 if(bind(s, (struct sockaddr *) &addr, alen) < 0) {
86 return s;
100 int s; local
102 s = socket(AF_LOCAL, type, 0);
103 if (s < 0) return -1;
105 err = socket_local_server_bind(s, name, namespaceId);
108 close(s);
115 ret = listen(s, LISTEN_BACKLOG);
[all …]
Dsocket_inaddr_any_server_unix.cpp36 int s, n; in socket_inaddr_any_server() local
43 s = socket(AF_INET6, type, 0); in socket_inaddr_any_server()
44 if (s < 0) return -1; in socket_inaddr_any_server()
47 setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *) &n, sizeof(n)); in socket_inaddr_any_server()
49 if (bind(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) { in socket_inaddr_any_server()
50 close(s); in socket_inaddr_any_server()
57 ret = listen(s, LISTEN_BACKLOG); in socket_inaddr_any_server()
60 close(s); in socket_inaddr_any_server()
65 return s; in socket_inaddr_any_server()
/system/libbase/
Dstrings.cpp37 std::vector<std::string> Split(const std::string& s, in Split() argument
46 found = s.find_first_of(delimiters, base); in Split()
47 result.push_back(s.substr(base, found - base)); in Split()
48 if (found == s.npos) break; in Split()
55 std::vector<std::string> Tokenize(const std::string& s, const std::string& delimiters) { in Tokenize() argument
62 size_t base = s.find_first_not_of(delimiters, end); in Tokenize()
63 if (base == s.npos) { in Tokenize()
66 end = s.find_first_of(delimiters, base); in Tokenize()
67 result.push_back(s.substr(base, end - base)); in Tokenize()
73 std::string Trim(const std::string& s) { in Trim() argument
[all …]
Dparsebool.cpp23 ParseBoolResult ParseBool(std::string_view s) { in ParseBool() argument
24 if (s == "1" || s == "y" || s == "yes" || s == "on" || s == "true") { in ParseBool()
27 if (s == "0" || s == "n" || s == "no" || s == "off" || s == "false") { in ParseBool()
Dfile_test.cpp39 std::string s("hello"); in TEST() local
41 ASSERT_FALSE(android::base::ReadFileToString("/proc/does-not-exist", &s)); in TEST()
43 EXPECT_EQ("", s); // s was cleared. in TEST()
51 std::string s; in TEST() local
52 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s)) in TEST()
54 EXPECT_EQ("abc", s); in TEST()
67 std::string s; in TEST() local
68 ASSERT_FALSE(android::base::ReadFileToString(link.path, &s)); in TEST()
70 ASSERT_TRUE(android::base::ReadFileToString(link.path, &s, true)); in TEST()
71 ASSERT_EQ("foo", s); in TEST()
[all …]
/system/libbase/include/android-base/
Dparseint.h35 bool ParseUint(const char* s, T* out, T max = std::numeric_limits<T>::max(),
38 while (isspace(*s)) {
39 s++;
42 if (s[0] == '-') {
50 int base = (s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) ? 16 : 10;
53 unsigned long long int result = strtoull(s, &end, base);
55 if (end == s) {
80 bool ParseUint(const std::string& s, T* out, T max = std::numeric_limits<T>::max(),
82 return ParseUint(s.c_str(), out, max, allow_suffixes);
86 bool ParseByteCount(const char* s, T* out, T max = std::numeric_limits<T>::max()) {
[all …]
Dstrings.h36 std::vector<std::string> Split(const std::string& s,
51 std::vector<std::string> Tokenize(const std::string& s, const std::string& delimiters);
61 std::string s; in Trim() local
68 s = t; in Trim()
69 sv = s; in Trim()
118 bool StartsWith(std::string_view s, std::string_view prefix);
119 bool StartsWith(std::string_view s, char prefix);
120 bool StartsWithIgnoreCase(std::string_view s, std::string_view prefix);
123 bool EndsWith(std::string_view s, std::string_view suffix);
124 bool EndsWith(std::string_view s, char suffix);
[all …]
Dparsedouble.h32 static inline bool ParseFloatingPoint(const char* s, T* out, T min, T max) { in ParseFloatingPoint() argument
35 T result = strtox(s, &end); in ParseFloatingPoint()
36 if (errno != 0 || s == end || *end != '\0') { in ParseFloatingPoint()
51 static inline bool ParseDouble(const char* s, double* out,
54 return ParseFloatingPoint<double, strtod>(s, out, min, max);
56 static inline bool ParseDouble(const std::string& s, double* out,
59 return ParseFloatingPoint<double, strtod>(s.c_str(), out, min, max);
65 static inline bool ParseFloat(const char* s, float* out,
68 return ParseFloatingPoint<float, strtof>(s, out, min, max);
70 static inline bool ParseFloat(const std::string& s, float* out,
[all …]
/system/libvintf/
Dparse_string.cpp35 std::vector<std::string> SplitString(const std::string &s, char c) { in SplitString() argument
40 while ((matchPos = s.find(c, startPos)) != std::string::npos) { in SplitString()
41 components.push_back(s.substr(startPos, matchPos - startPos)); in SplitString()
45 if (startPos <= s.length()) { in SplitString()
46 components.push_back(s.substr(startPos)); in SplitString()
65 bool parse(const std::string &s, std::vector<T> *objs) { in parse() argument
66 std::vector<std::string> v = SplitString(s, ','); in parse()
80 bool parseEnum(const std::string &s, E *e, const Array &strings) { in parseEnum() argument
82 if (s == strings.at(i)) { in parseEnum()
91 bool parse(const std::string &s, ENUM *hf) { \
[all …]
/system/core/libutils/
DErrors_test.cpp43 status_t s = f(true, &val); in TEST() local
44 EXPECT_EQ(OK, s); in TEST()
63 auto s = f(false); in TEST() local
64 EXPECT_FALSE(s.ok()); in TEST()
65 EXPECT_EQ(PERMISSION_DENIED, s.error().code()); in TEST()
66 EXPECT_EQ("PERMISSION_DENIED", s.error().message()); in TEST()
79 auto s = f(false); in TEST() local
80 EXPECT_FALSE(s.ok()); in TEST()
81 EXPECT_EQ(PERMISSION_DENIED, s.error().code()); in TEST()
82 EXPECT_EQ("PERMISSION_DENIED", s.error().message()); in TEST()
[all …]
/system/logging/logd/
DLogKlog.cpp52 static char* is_prio(char* s, ssize_t len) { in is_prio() argument
53 if ((len <= 0) || !isdigit(*s++)) return nullptr; in is_prio()
58 while (((c = *s++)) && (++priolen <= max_prio_len)) { in is_prio()
59 if (!isdigit(c)) return ((c == '>') && (*s == '[')) ? s : nullptr; in is_prio()
65 static char* is_timestamp(char* s, ssize_t len) { in is_timestamp() argument
66 while ((len > 0) && (*s == ' ')) { in is_timestamp()
67 ++s; in is_timestamp()
70 if ((len <= 0) || !isdigit(*s++)) return nullptr; in is_timestamp()
74 while ((len > 0) && ((c = *s++))) { in is_timestamp()
79 return ((c == ']') && !first_period && (*s == ' ')) ? s : nullptr; in is_timestamp()
[all …]
/system/extras/simpleperf/
DRegEx.cpp29 RegExMatchImpl(std::string_view s, const std::regex& re) in RegExMatchImpl() argument
30 : match_it_(s.data(), s.data() + s.size(), re) {} in RegExMatchImpl()
47 bool Match(std::string_view s) const override { in Match()
48 return std::regex_match(s.begin(), s.end(), re_); in Match()
50 bool Search(std::string_view s) const override { in Search()
51 return std::regex_search(s.begin(), s.end(), re_); in Search()
53 std::unique_ptr<RegExMatch> SearchAll(std::string_view s) const override { in SearchAll()
54 return std::unique_ptr<RegExMatch>(new RegExMatchImpl(s, re_)); in SearchAll()
56 std::optional<std::string> Replace(const std::string& s, in Replace() argument
59 return {std::regex_replace(s, re_, format)}; in Replace()
Dbuild_id.h46 explicit BuildId(const std::string& s) : BuildId() { in BuildId() argument
47 for (size_t i = 0; i < s.size() && i < BUILD_ID_SIZE * 2; i += 2) { in BuildId()
51 if (s[j] >= '0' && s[j] <= '9') { in BuildId()
52 ch |= s[j] - '0'; in BuildId()
53 } else if (s[j] >= 'a' && s[j] <= 'f') { in BuildId()
54 ch |= s[j] - 'a' + 10; in BuildId()
55 } else if (s[j] >= 'A' && s[j] <= 'F') { in BuildId()
56 ch |= s[j] - 'A' + 10; in BuildId()
66 std::string s = "0x"; in ToString() local
68 s += android::base::StringPrintf("%02x", data_[i]); in ToString()
[all …]
Dcmd_stat.cpp97 for (const auto& s : summaries_) { in FindSummary() local
98 if (s.type_name == type_name && s.modifier == modifier && s.thread == thread && s.cpu == cpu) { in FindSummary()
99 return &s; in FindSummary()
107 const CounterSummary& s = summaries_[i]; in AutoGenerateSummaries() local
108 if (s.modifier == "u") { in AutoGenerateSummaries()
109 const CounterSummary* other = FindSummary(s.type_name, "k", s.thread, s.cpu); in AutoGenerateSummaries()
110 if (other != nullptr && other->IsMonitoredAtTheSameTime(s)) { in AutoGenerateSummaries()
111 if (FindSummary(s.type_name, "", s.thread, s.cpu) == nullptr) { in AutoGenerateSummaries()
112 summaries_.emplace_back(s.type_name, "", s.group_id, s.thread, s.cpu, in AutoGenerateSummaries()
113 s.count + other->count, s.runtime_in_ns, s.scale, true, csv_); in AutoGenerateSummaries()
[all …]
/system/core/libutils/include/utils/
DErrorsMacros.h40 StatusT(status_t s) : val_(s) {} in StatusT()
56 ResultError(status_t s) : val_(s) {
57 LOG_FATAL_IF(s == OK, "Result error should not hold success");
75 ResultError(T&& message, status_t s) : val_(s), message_(std::forward<T>(message)) {
76 LOG_FATAL_IF(s == OK, "Result error should not hold success");
79 ResultError(status_t s) : val_(s) {}
101 static bool IsOk(const status_t& s) { return s == OK; }
105 static void Unwrap([[maybe_unused]] status_t&& s) { assert(IsOk(s)); }
108 static OkOrFail<status_t> Fail(status_t&& s) {
109 assert(!IsOk(s));
[all …]
/system/core/libsparse/include/sparse/
Dsparse.h58 void sparse_file_destroy(struct sparse_file *s);
78 int sparse_file_add_data(struct sparse_file* s, void* data, uint64_t len, unsigned int block);
95 int sparse_file_add_fill(struct sparse_file* s, uint32_t fill_val, uint64_t len,
118 int sparse_file_add_file(struct sparse_file* s, const char* filename, int64_t file_offset,
144 int sparse_file_add_fd(struct sparse_file* s, int fd, int64_t file_offset, uint64_t len,
165 int sparse_file_write(struct sparse_file *s, int fd, bool gz, bool sparse,
180 int64_t sparse_file_len(struct sparse_file *s, bool sparse, bool crc);
187 unsigned int sparse_file_block_size(struct sparse_file *s);
207 int sparse_file_callback(struct sparse_file *s, bool sparse, bool crc,
224 int sparse_file_foreach_chunk(struct sparse_file *s, bool sparse, bool crc,
[all …]
/system/core/init/
Dtokenizer.cpp11 char *s; in next_token() local
49 *s = 0; in next_token()
52 state->text = s = x; in next_token()
79 *s++ = *x++; in next_token()
89 *s++ = '\n'; in next_token()
93 *s++ = '\r'; in next_token()
97 *s++ = '\t'; in next_token()
101 *s++ = '\\'; in next_token()
121 *s++ = *x++; in next_token()
125 *s++ = *x++; in next_token()
/system/nfc/src/fuzzers/
Dfuzz_utils.cc23 auto s = *Data++; in UnpackPackets() local
26 if (s > Size) { in UnpackPackets()
27 s = Size; in UnpackPackets()
30 if (s > 0) { in UnpackPackets()
31 result.push_back(bytes_t(Data, Data + s)); in UnpackPackets()
34 Size -= s; in UnpackPackets()
35 Data += s; in UnpackPackets()
46 auto s = it->size(); in PackPackets() local
47 if (s == 0) { in PackPackets()
52 if (s > MaxSize - 1) { in PackPackets()
[all …]

12345678910>>...44