Skip to content

Commit 19e2b76

Browse files
committed
uftrace: Fix typo in comment
Signed-off-by: Handong Choi <[email protected]>
1 parent 7817a96 commit 19e2b76

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

libmcount/mcount.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ void mcount_entry_filter_record(struct mcount_thread_data *mtdp,
10001000
* Flush existing rstack when mcount_enabled is off
10011001
* (i.e. disabled). Note that changing to enabled is
10021002
* already handled in record_trace_data() on exit path
1003-
* using the MCOUNT_FL_DISALBED flag.
1003+
* using the MCOUNT_FL_DISABLED flag.
10041004
*/
10051005
if (unlikely(mtdp->enable_cached))
10061006
record_trace_data(mtdp, rstack, NULL);
@@ -1268,7 +1268,7 @@ static unsigned long __mcount_exit(long *retval)
12681268
assert(!mtdp->dead);
12691269

12701270
/*
1271-
* it's only called when mcount_entry() was succeeded
1271+
* it's only called when mcount_entry() was succeeded and
12721272
* no need to check recursion here. But still needs to
12731273
* prevent recursion during this call.
12741274
*/
@@ -1292,8 +1292,8 @@ static unsigned long __mcount_exit(long *retval)
12921292
mtd_dtor(mtdp);
12931293
/*
12941294
* mtd_dtor() will free rstack but current ret_addr
1295-
* might be plthook_return() when it was a tailcall.
1296-
* reload the return address after mtd_dtor() restored
1295+
* might be plthook_return() when it was a tail call.
1296+
* Reload the return address after mtd_dtor() restored
12971297
* all the parent locations.
12981298
*/
12991299
retaddr = *ret_loc;
@@ -1415,7 +1415,7 @@ static void __cygprof_exit(unsigned long parent, unsigned long child)
14151415

14161416
/*
14171417
* cygprof_exit() can be called beyond rstack max.
1418-
* it cannot use mcount_check_rstack() here
1418+
* It cannot use mcount_check_rstack() here
14191419
* since we didn't decrease the idx yet.
14201420
*/
14211421
if (mtdp->idx > mcount_rstack_max)
@@ -1533,7 +1533,7 @@ static void _xray_exit(long *retval)
15331533

15341534
/*
15351535
* cygprof_exit() can be called beyond rstack max.
1536-
* it cannot use mcount_check_rstack() here
1536+
* It cannot use mcount_check_rstack() here
15371537
* since we didn't decrease the idx yet.
15381538
*/
15391539
if (mtdp->idx > mcount_rstack_max)

libmcount/plthook.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -642,12 +642,12 @@ static void setup_vfork(struct mcount_thread_data *mtdp)
642642
update_kernel_tid(tmsg.tid);
643643
}
644644

645-
/* this function detects whether child finished */
645+
/* this function detects whether child is finished */
646646
static struct mcount_ret_stack * restore_vfork(struct mcount_thread_data *mtdp,
647647
struct mcount_ret_stack *rstack)
648648
{
649649
/*
650-
* On vfork, parent sleeps until child exec'ed or exited.
650+
* On vfork, parent sleeps until child is exec'ed or exited.
651651
* So if it sees parent pid, that means child was done.
652652
*/
653653
if (getpid() == vfork_parent) {
@@ -918,7 +918,7 @@ static unsigned long __plthook_exit(long *retval)
918918
assert(!check_thread_data(mtdp));
919919

920920
/*
921-
* it's only called when mcount_entry() was succeeded
921+
* it's only called when mcount_entry() was succeeded and
922922
* no need to check recursion here. But still needs to
923923
* prevent recursion during this call.
924924
*/
@@ -995,8 +995,8 @@ static unsigned long __plthook_exit(long *retval)
995995
mtd_dtor(mtdp);
996996
/*
997997
* mtd_dtor() will free rstack but current ret_addr
998-
* might be plthook_return() when it was a tailcall.
999-
* reload the return address after mtd_dtor() restored
998+
* might be plthook_return() when it was a tail call.
999+
* Reload the return address after mtd_dtor() restored
10001000
* all the parent locations.
10011001
*/
10021002
if (ARCH_CAN_RESTORE_PLTHOOK)

libmcount/record.c

+12-10
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static void get_new_shmem_buffer(struct mcount_thread_data *mtdp)
131131

132132
reuse:
133133
/*
134-
* Start a new buffer and mark it recording data.
134+
* Start a new buffer and mark its recording data.
135135
* See cmd-record.c::writer_thread().
136136
*/
137137
__sync_fetch_and_or(&curr_buf->flag, SHMEM_FL_RECORDING);
@@ -554,9 +554,11 @@ static int save_proc_statm(void *ctx, void *buf)
554554
if (fscanf(fp, "%"SCNu64" %"SCNu64" %"SCNu64,
555555
&statm->vmsize, &statm->vmrss, &statm->shared) != 3)
556556
pr_err("failed to scan /proc/self/statm");
557-
558-
/* Since /proc/[pid]/statm prints the number of pages for each field,
559-
* it'd be better to keep the memory size in KB. */
557+
558+
/*
559+
* Since /proc/[pid]/statm prints the number of pages for each field,
560+
* it'd be better to keep the memory size in KB.
561+
*/
560562
statm->vmsize *= page_size_in_kb;
561563
statm->vmrss *= page_size_in_kb;
562564
statm->shared *= page_size_in_kb;
@@ -747,8 +749,8 @@ void save_watchpoint(struct mcount_thread_data *mtdp,
747749
* Normally watch point event comes before the rstack (record)
748750
* in order to indicate where it's changed precisely.
749751
* But first watch point event needs to come after the first
750-
* record otherwise it'd not shown since 'event-skip' mechanism.
751-
* so add 2(nsec) so that it can be 1 nsec later.
752+
* record otherwise it'd not show since 'event-skip' mechanism.
753+
* Therefore, add 2(nsec) so that it can be 1 nsec later.
752754
*/
753755
timestamp += 2;
754756
mtdp->watch.inited = true;
@@ -853,8 +855,8 @@ static int record_event(struct mcount_thread_data *mtdp,
853855
rec = (void *)(curr_buf->data + curr_buf->size);
854856

855857
/*
856-
* instead of set bitfields, do the bit operations manually.
857-
* this would be good both for performance and portability.
858+
* instead of set bit fields, do the bit operations manually.
859+
* this would be good for both performance and portability.
858860
*/
859861
rec->data = UFTRACE_EVENT | RECORD_MAGIC << 3;
860862
rec->data += (uint64_t)event->id << 16;
@@ -944,8 +946,8 @@ static int record_ret_stack(struct mcount_thread_data *mtdp,
944946
frstack->addr = mrstack->child_ip;
945947
#else
946948
/*
947-
* instead of set bitfields, do the bit operations manually.
948-
* this would be good both for performance and portability.
949+
* instead of set bit fields, do the bit operations manually.
950+
* this would be good for both performance and portability.
949951
*/
950952
rec = type | RECORD_MAGIC << 3;
951953
rec += argbuf ? 4 : 0;

libmcount/wrap.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void mcount_rstack_reset_exception(struct mcount_thread_data *mtdp,
9797
int idx;
9898
struct mcount_ret_stack *rstack;
9999

100-
/* it needs to find how much stack frame was unwinded */
100+
/* it needs to find how much stack frame unwinds */
101101
for (idx = mtdp->idx - 1; idx >= 0; idx--) {
102102
rstack = &mtdp->rstack[idx];
103103

@@ -109,7 +109,7 @@ void mcount_rstack_reset_exception(struct mcount_thread_data *mtdp,
109109
/*
110110
* there might be tail call optimizations in the
111111
* middle of the exception handling path.
112-
* in that case, we need to keep the original
112+
* In that case, we need to keep the original
113113
* mtdp->idx but update parent address of the
114114
* first rstack of the tail call chain.
115115
*/
@@ -133,7 +133,7 @@ void mcount_rstack_reset_exception(struct mcount_thread_data *mtdp,
133133
break;
134134
}
135135

136-
/* record unwinded functions */
136+
/* record unwound functions */
137137
if (!(rstack->flags & MCOUNT_FL_NORECORD))
138138
rstack->end_time = mcount_gettime();
139139

0 commit comments

Comments
 (0)