Home
last modified time | relevance | path

Searched refs:sum (Results 1 – 25 of 29) sorted by relevance

12

/system/core/libnetutils/
Dpacket.c68 uint32_t sum = startsum; in checksum() local
72 sum += *up++; in checksum()
76 sum += (uint16_t) *(uint8_t *)up; in checksum()
78 while ((upper16 = (sum >> 16)) != 0) { in checksum()
79 sum = (sum & 0xffff) + upper16; in checksum()
81 return sum; in checksum()
84 static uint32_t finish_sum(uint32_t sum) in finish_sum() argument
86 return ~sum & 0xffff; in finish_sum()
166 uint32_t sum; in receive_packet() local
210 sum = finish_sum(checksum(&packet.ip, sizeof(packet.ip), 0)); in receive_packet()
[all …]
/system/netd/bpf_progs/
Dclatd.c126 __u32 sum = 0; in nat64() local
128 sum += ((__u16*)&ip)[i]; in nat64()
131 sum = (sum & 0xFFFF) + (sum >> 16); // collapse u32 into range 1 .. 0x1FFFE in nat64()
132 sum = (sum & 0xFFFF) + (sum >> 16); // collapse any potential carry into u16 in nat64()
133 ip.check = (__u16)~sum; // sum cannot be zero, so this is never 0xFFFF in nat64()
/system/extras/simpleperf/
Drecord_lib_interface.cpp183 Counter& sum = (*counters)[i]; in ReadRawCounters() local
184 sum.event = name; in ReadRawCounters()
185 sum.value = 0; in ReadRawCounters()
186 sum.time_enabled_in_ns = 0; in ReadRawCounters()
187 sum.time_running_in_ns = 0; in ReadRawCounters()
189 sum.value += c.counter.value; in ReadRawCounters()
190 sum.time_enabled_in_ns += c.counter.time_enabled; in ReadRawCounters()
191 sum.time_running_in_ns += c.counter.time_running; in ReadRawCounters()
Dcmd_stat.cpp706 CounterSum sum; in ShowCounters() local
708 sum.value += counter_info.counter.value; in ShowCounters()
709 sum.time_enabled += counter_info.counter.time_enabled; in ShowCounters()
710 sum.time_running += counter_info.counter.time_running; in ShowCounters()
716 CounterSum tmp = sum; in ShowCounters()
717 sum.value -= last_sum_values_[i].value; in ShowCounters()
718 sum.time_enabled -= last_sum_values_[i].time_enabled; in ShowCounters()
719 sum.time_running -= last_sum_values_[i].time_running; in ShowCounters()
724 if (sum.time_running < sum.time_enabled && sum.time_running != 0) { in ShowCounters()
725 scale = static_cast<double>(sum.time_enabled) / sum.time_running; in ShowCounters()
[all …]
/system/extras/tests/ext4/
Drand_emmc_perf.c54 struct timeval sum = { 0, 0 }; in print_stats() local
80 timeradd(&sum, &t, &sum); in print_stats()
88 total_usecs = (sum.tv_sec * 1000000LL) + sum.tv_usec; in print_stats()
/system/bt/osi/test/
Dlist_test.cc150 int* sum = (int*)context; in list_callback_sum() local
152 *sum += *value; in list_callback_sum()
171 int sum = 0; in TEST_F() local
172 list_node_t* rc = list_foreach(list, list_callback_sum, &sum); in TEST_F()
173 EXPECT_EQ(sum, 15); in TEST_F()
/system/libhidl/
Dtest_main.cpp256 int32_t sum = 0; // range based for loop interoperability in TEST_F() local
258 sum += i; in TEST_F()
260 EXPECT_EQ(sum, 5+6+7); in TEST_F()
266 sum = 0; in TEST_F()
268 sum += i; in TEST_F()
270 EXPECT_EQ(sum, 15+16+17); in TEST_F()
314 int sum = 0; in TEST_F() local
317 sum += hv[i]; in TEST_F()
319 EXPECT_EQ(sum, 1 + 2 + 3); in TEST_F()
/system/core/libmemtrack/
Dmemtrack.cpp119 ssize_t sum = 0; in memtrack_proc_sum() local
126 sum += records[j].sizeInBytes; in memtrack_proc_sum()
131 return sum; in memtrack_proc_sum()
/system/media/audio_utils/include/audio_utils/
DStatistics.h728 constexpr auto sum(T begin, T end) {
729 S sum{};
731 sum += D(*it);
733 return sum;
739 S sum{};
742 sum += diff * diff;
744 return sum;
759 constexpr D sum(const T (&a)[N]) {
760 return sum<D, S>(&a[0], &a[N]);
Dfifo.h80 uint32_t sum(uint32_t index, uint32_t increment) const;
/system/media/audio_utils/tests/
Dstatistics_tests.cpp63 , mMean{android::audio_utils::sum(a) / mN}
144 double rssum = android::audio_utils::sum<double, double>(simple); in TEST()
147 android::audio_utils::sum<double, android::audio_utils::KahanSum<double>>(simple); in TEST()
150 android::audio_utils::sum<double, android::audio_utils::NeumaierSum<double>>(simple); in TEST()
185 rssum = android::audio_utils::sum<double, double>(tricky); in TEST()
187 kssum = android::audio_utils::sum<double, android::audio_utils::KahanSum<double>>(tricky); in TEST()
189 nmsum = android::audio_utils::sum<double, android::audio_utils::NeumaierSum<double>>(tricky); in TEST()
/system/update_engine/scripts/
Dpayload_info.py139 num_blocks = sum([ext.num_blocks for ext in extents])
181 read_blocks += sum([ext.num_blocks for ext in curr_op.src_extents])
182 written_blocks += sum([ext.num_blocks for ext in curr_op.dst_extents])
/system/media/audio_utils/
Dminifloat.c32 #error EXPONENT_BITS and MANTISSA_BITS must sum to 16
Dsample.c37 #error SIGN_BITS, EXPONENT_BITS and MANTISSA_BITS must sum to 16
Dfifo.cpp51 uint32_t audio_utils_fifo_base::sum(uint32_t index, uint32_t increment) const in sum() function in audio_utils_fifo_base
317 mLocalRear = mFifo.sum(mLocalRear, count); in release()
348 mLocalRear = mFifo.sum(mLocalRear, count); in release()
475 mLocalFront = mFifo.sum(mLocalFront, count); in release()
506 mLocalFront = mFifo.sum(mLocalFront, count); in release()
Dprimitives.c573 int32_t sum; in accumulate_u8() local
576 sum = *dst + *src++ - 0x80; in accumulate_u8()
578 *dst++ = (sum & 0x100) ? (~sum >> 9) : sum; in accumulate_u8()
/system/update_engine/common/
Dutils.h241 uint64_t sum = 0; in BlocksInExtents() local
243 sum += ext.num_blocks(); in BlocksInExtents()
245 return sum; in BlocksInExtents()
/system/extras/tests/workloads/
Dsystemapps.sh259 sum=$3
260 ((ave=sum/iterations))
/system/update_engine/scripts/update_payload/
Dhistogram.py55 self.total = sum([count for key, count in self.data])
/system/extras/boottime_tools/bootanalyze/
Dbootanalyze.py179 item[0], sum(item[1])/num_runs, stddev(item[1]),\
187 item[0], sum(item[1])/num_runs, stddev(item[1]),\
197 item[0], sum(item[1])/num_runs, stddev(item[1]),\
212 average_with_stddev.append((item[0], sum(item[1])/len(item[1]), stddev(item[1]),\
224 average = sum(item[1])/len(item[1])
815 avg = sum(data) / items_count
816 sq_diffs_sum = sum([(v - avg) ** 2 for v in data])
/system/core/storaged/tests/
Dstoraged_test.cpp125 double sum = 0.0; in mean() local
127 sum += i; in mean()
129 return sum / nums.size(); in mean()
133 double sum = 0.0; in standard_deviation() local
136 sum += ((double)i - avg) * ((double)i - avg); in standard_deviation()
138 return sqrt(sum / nums.size()); in standard_deviation()
/system/core/init/
Dperfboot.py338 return float(sum(data)) / len(data)
344 return math.sqrt(sum((x - m) ** 2 for x in data) / len(data))
/system/extras/perfprofd/
Dperf_profile.proto96 // This is the sum of counts of address_samples and range_samples in all
/system/vold/bench/
Dbenchgen.py345 size = sum([ f.size for f in files.values() ])
/system/core/adb/
Dadb.cpp77 uint32_t sum = 0; in calculate_apacket_checksum() local
79 sum += static_cast<uint8_t>(p->payload[i]); in calculate_apacket_checksum()
81 return sum; in calculate_apacket_checksum()

12