Skip to content

Commit 5a2d5ec

Browse files
cuiziweizwopenvela-robot
authored andcommitted
binderlib: Remove redundant comments and rename the incoming parameters.
Change-Id: I4a3c3a1c6d76a6c5203f6189528872db137ef46e
1 parent 0c4c2c6 commit 5a2d5ec

File tree

2 files changed

+33
-34
lines changed

2 files changed

+33
-34
lines changed

binderlib/base/IPCThreadState.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,26 @@ static const char* statusToString(int32_t s)
5555
*/
5656

5757
static const char* kReturnStrings[] = {
58-
"BR_ERROR",
59-
"BR_OK",
60-
"BR_TRANSACTION",
61-
"BR_REPLY",
62-
"BR_ACQUIRE_RESULT",
63-
"BR_DEAD_REPLY",
64-
"BR_TRANSACTION_COMPLETE",
65-
"BR_INCREFS",
6658
"BR_ACQUIRE",
67-
"BR_RELEASE",
68-
"BR_DECREFS",
59+
"BR_ACQUIRE_RESULT",
6960
"BR_ATTEMPT_ACQUIRE",
70-
"BR_NOOP",
71-
"BR_SPAWN_LOOPER",
72-
"BR_FINISHED",
73-
"BR_DEAD_BINDER",
7461
"BR_CLEAR_DEATH_NOTIFICATION_DONE",
62+
"BR_DECREFS",
63+
"BR_DEAD_BINDER",
64+
"BR_DEAD_REPLY",
65+
"BR_ERROR",
7566
"BR_FAILED_REPLY",
67+
"BR_FINISHED",
7668
"BR_FROZEN_REPLY",
69+
"BR_INCREFS",
70+
"BR_NOOP",
71+
"BR_OK",
7772
"BR_ONEWAY_SPAM_SUSPECT",
73+
"BR_RELEASE",
74+
"BR_REPLY",
75+
"BR_SPAWN_LOOPER",
76+
"BR_TRANSACTION",
77+
"BR_TRANSACTION_COMPLETE",
7878
"BR_TRANSACTION_SEC_CTX",
7979
};
8080

performance/latency/latency_time.h

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,53 +23,52 @@
2323
#define deadline_us 2500
2424
#define GOOD_SYNC_MIN 0.6
2525

26-
typedef std::chrono::time_point<std::chrono::high_resolution_clock> Tick;
26+
typedef std::chrono::time_point<std::chrono::high_resolution_clock> Ticks;
2727

28-
static inline Tick tickNow()
28+
static inline Ticks tickNow()
2929
{
3030
return std::chrono::high_resolution_clock::now();
3131
}
3232

33-
static inline uint64_t tickNano(Tick& sta, Tick& end)
33+
static inline uint64_t tickNano(Ticks& sta, Ticks& end)
3434
{
3535
return uint64_t(std::chrono::duration_cast<std::chrono::nanoseconds>(end - sta).count());
3636
}
3737

3838
struct Results {
39-
uint64_t m_best = 0xffffffffffffffffULL;
40-
uint64_t m_worst = 0;
41-
uint64_t m_transactions = 0;
42-
uint64_t m_total_time = 0;
39+
uint64_t best = 0xffffffffffffffffULL;
40+
uint64_t worst = 0;
41+
uint64_t trans = 0;
42+
uint64_t total_time = 0;
4343
uint64_t m_miss = 0;
4444
bool tracing;
4545
explicit Results(bool _tracing)
4646
: tracing(_tracing)
4747
{
4848
}
49-
inline bool miss_deadline(uint64_t nano)
49+
inline bool miss_deadline(uint64_t nanos)
5050
{
51-
return nano > deadline_us * 1000;
51+
return nanos > deadline_us * 1000;
5252
}
53-
void add_time(uint64_t nano)
53+
void add_time(uint64_t nanos)
5454
{
55-
m_best = std::min(nano, m_best);
56-
m_worst = std::max(nano, m_worst);
57-
m_transactions += 1;
58-
m_total_time += nano;
59-
if (miss_deadline(nano))
55+
best = std::min(nanos, best);
56+
worst = std::max(nanos, worst);
57+
trans += 1;
58+
total_time += nanos;
59+
if (miss_deadline(nanos))
6060
m_miss++;
6161
}
6262
void dump()
6363
{
64-
double best = (double)m_best / 1.0E6;
65-
double worst = (double)m_worst / 1.0E6;
66-
double average = (double)m_total_time / m_transactions / 1.0E6;
67-
// TODO: libjson?
64+
double best = (double)best / 1.0E6;
65+
double worst = (double)worst / 1.0E6;
66+
double average = (double)total_time / trans / 1.0E6;
6867
int W = DUMP_PRESICION + 2;
6968

7069
printf("{ \"avg\":%*.*f,\"wst\":%*.*f,\"bst\":%*.*f,\"miss\":%" PRIu64 ",\"meetR\":%.3f}\n",
7170
W, DUMP_PRESICION, average, W, DUMP_PRESICION, worst, W, DUMP_PRESICION,
72-
best, m_miss, 1.0 - (double)m_miss / m_transactions);
71+
best, m_miss, 1.0 - (double)m_miss / trans);
7372
}
7473
};
7574

0 commit comments

Comments
 (0)