Skip to content

Commit 863caa8

Browse files
authored
Merge pull request #16 from orivej/fix-merge-with-bitbucket
Restore blank lines deleted in "merge from bitbucket"
2 parents 1736058 + e741327 commit 863caa8

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

callstack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ screate(int size)
2424
yfree(cs);
2525
return NULL;
2626
}
27+
2728
for(i=0; i<size; i++) {
2829
cs->_items[i].ckey = 0;
2930
cs->_items[i].t0 = 0;

hashtab.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ _hgrow(_htab *ht)
2323
int i;
2424
_htab *dummy;
2525
_hitem *p, *next, *it;
26+
2627
dummy = htcreate(ht->logsize+1);
2728
if (!dummy)
2829
return 0;
@@ -102,6 +103,7 @@ hadd(_htab *ht, uintptr_t key, uintptr_t val)
102103
{
103104
unsigned int h;
104105
_hitem *new, *p;
106+
105107
h = HHASH(ht, key);
106108
p = ht->_table[h];
107109
new = NULL;
@@ -144,6 +146,7 @@ hfind(_htab *ht, uintptr_t key)
144146
{
145147
_hitem *p;
146148
unsigned int h;
149+
147150
h = HHASH(ht, key);
148151
p = ht->_table[h];
149152
while(p) {

timing.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ tickcount(void)
4343
{
4444
LARGE_INTEGER li;
4545
FILETIME ftCreate, ftExit, ftKernel, ftUser;
46+
4647
if (g_clock_type == CPU_CLOCK) {
4748
GetThreadTimes(GetCurrentThread(), &ftCreate, &ftExit, &ftKernel, &ftUser);
4849
li.LowPart = ftKernel.dwLowDateTime+ftUser.dwLowDateTime;
@@ -57,6 +58,7 @@ double
5758
tickfactor(void)
5859
{
5960
LARGE_INTEGER li;
61+
6062
if (g_clock_type == WALL_CLOCK) {
6163
if (QueryPerformanceFrequency(&li)) {
6264
return 1.0 / li.QuadPart;
@@ -66,6 +68,7 @@ tickfactor(void)
6668
} else if (g_clock_type == CPU_CLOCK) {
6769
return 0.0000001;
6870
}
71+
6972
return 0.0000001; // for suppressing warning: all paths must return a value
7073
}
7174

@@ -75,6 +78,7 @@ long long
7578
tickcount(void)
7679
{
7780
long long rc;
81+
7882
rc = 0;
7983
if (g_clock_type == CPU_CLOCK) {
8084
kern_return_t kr;
@@ -85,6 +89,7 @@ tickcount(void)
8589
tinfo_cnt = THREAD_INFO_MAX;
8690
kr = thread_info(mach_thread_self(), THREAD_BASIC_INFO, (thread_info_t)tinfo_d, &tinfo_cnt);
8791
tinfo_b = (thread_basic_info_t)tinfo_d;
92+
8893
if (!(tinfo_b->flags & TH_FLAGS_IDLE))
8994
{
9095
rc = (tinfo_b->user_time.seconds + tinfo_b->system_time.seconds);
@@ -108,16 +113,19 @@ long long
108113
tickcount(void)
109114
{
110115
long long rc;
116+
111117
rc = 0; // suppress "may be uninitialized" warning
112118
if (g_clock_type == CPU_CLOCK) {
113119
#if defined(USE_CLOCK_TYPE_CLOCKGETTIME)
114120
struct timespec tp;
121+
115122
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp);
116123
rc = tp.tv_sec;
117124
rc = rc * 1000000000 + (tp.tv_nsec);
118125
#elif (defined(USE_CLOCK_TYPE_RUSAGE) && defined(RUSAGE_WHO))
119126
struct timeval tv;
120127
struct rusage usage;
128+
121129
getrusage(RUSAGE_WHO, &usage);
122130
rc = (usage.ru_utime.tv_sec + usage.ru_stime.tv_sec);
123131
rc = (rc * 1000000) + (usage.ru_utime.tv_usec + usage.ru_stime.tv_usec);
@@ -140,6 +148,7 @@ tickfactor(void)
140148
} else if (g_clock_type == WALL_CLOCK) {
141149
return 0.000001;
142150
}
151+
143152
return 1.0; // suppress "reached end of non-void function" warning
144153
}
145154

yappi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def convert2pstats(stats):
144144
"""
145145
if not isinstance(stats, YFuncStats):
146146
raise YappiError("Source stats must be derived from YFuncStats.")
147+
147148
import pstats
148149
class _PStatHolder:
149150
def __init__(self, d):
@@ -278,6 +279,7 @@ def __add__(self, other):
278279
self.ttot += other.ttot
279280
self.tsub += other.tsub
280281
self.tavg = self.ttot / self.ncall
282+
281283
for other_child_stat in other.children:
282284
# all children point to a valid entry, and we shall have merged previous entries by here.
283285
self.children.append(other_child_stat)
@@ -338,6 +340,7 @@ def __add__(self, other):
338340
self.tsub += other.tsub
339341
self.tavg = self.ttot / self.ncall
340342
return self
343+
341344
class YThreadStat(YStat):
342345
"""
343346
Class holding information for thread stats.
@@ -521,6 +524,7 @@ class YFuncStats(YStatsIndexable):
521524
_sort_order = None
522525
_SUPPORTED_LOAD_FORMATS = ['YSTAT']
523526
_SUPPORTED_SAVE_FORMATS = ['YSTAT', 'CALLGRIND', 'PSTAT']
527+
524528
def __init__(self, files=[]):
525529
super(YFuncStats, self).__init__()
526530
self.add(files)
@@ -594,6 +598,7 @@ def _add_from_YSTAT(self, file):
594598
saved_stats, saved_clock_type = pickle.load(file)
595599
except:
596600
raise YappiError("Unable to load the saved profile information from %s." % (file.name))
601+
597602
# check if we really have some stats to be merged?
598603
if not self.empty():
599604
if self._clock_type != saved_clock_type and self._clock_type is not None:
@@ -632,6 +637,7 @@ def _save_as_PSTAT(self, path):
632637
"""
633638
_stats = convert2pstats(self)
634639
_stats.dump_stats(path)
640+
635641
def _save_as_CALLGRIND(self, path):
636642
"""
637643
Writes all the function stats in a callgrind-style format to the given

0 commit comments

Comments
 (0)