Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uftrace: Fix typo in comment #990

Merged
merged 1 commit into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions libmcount/mcount.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ void mcount_entry_filter_record(struct mcount_thread_data *mtdp,
* Flush existing rstack when mcount_enabled is off
* (i.e. disabled). Note that changing to enabled is
* already handled in record_trace_data() on exit path
* using the MCOUNT_FL_DISALBED flag.
* using the MCOUNT_FL_DISABLED flag.
*/
if (unlikely(mtdp->enable_cached))
record_trace_data(mtdp, rstack, NULL);
Expand Down Expand Up @@ -1268,7 +1268,7 @@ static unsigned long __mcount_exit(long *retval)
assert(!mtdp->dead);

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

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

/*
* cygprof_exit() can be called beyond rstack max.
* it cannot use mcount_check_rstack() here
* It cannot use mcount_check_rstack() here
* since we didn't decrease the idx yet.
*/
if (mtdp->idx > mcount_rstack_max)
Expand Down
10 changes: 5 additions & 5 deletions libmcount/plthook.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,12 @@ static void setup_vfork(struct mcount_thread_data *mtdp)
update_kernel_tid(tmsg.tid);
}

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

/*
* it's only called when mcount_entry() was succeeded
* it's only called when mcount_entry() was succeeded and
* no need to check recursion here. But still needs to
* prevent recursion during this call.
*/
Expand Down Expand Up @@ -995,8 +995,8 @@ static unsigned long __plthook_exit(long *retval)
mtd_dtor(mtdp);
/*
* mtd_dtor() will free rstack but current ret_addr
* might be plthook_return() when it was a tailcall.
* reload the return address after mtd_dtor() restored
* might be plthook_return() when it was a tail call.
* Reload the return address after mtd_dtor() restored
* all the parent locations.
*/
if (ARCH_CAN_RESTORE_PLTHOOK)
Expand Down
22 changes: 12 additions & 10 deletions libmcount/record.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static void get_new_shmem_buffer(struct mcount_thread_data *mtdp)

reuse:
/*
* Start a new buffer and mark it recording data.
* Start a new buffer and mark its recording data.
* See cmd-record.c::writer_thread().
*/
__sync_fetch_and_or(&curr_buf->flag, SHMEM_FL_RECORDING);
Expand Down Expand Up @@ -554,9 +554,11 @@ static int save_proc_statm(void *ctx, void *buf)
if (fscanf(fp, "%"SCNu64" %"SCNu64" %"SCNu64,
&statm->vmsize, &statm->vmrss, &statm->shared) != 3)
pr_err("failed to scan /proc/self/statm");

/* Since /proc/[pid]/statm prints the number of pages for each field,
* it'd be better to keep the memory size in KB. */

/*
* Since /proc/[pid]/statm prints the number of pages for each field,
* it'd be better to keep the memory size in KB.
*/
statm->vmsize *= page_size_in_kb;
statm->vmrss *= page_size_in_kb;
statm->shared *= page_size_in_kb;
Expand Down Expand Up @@ -747,8 +749,8 @@ void save_watchpoint(struct mcount_thread_data *mtdp,
* Normally watch point event comes before the rstack (record)
* in order to indicate where it's changed precisely.
* But first watch point event needs to come after the first
* record otherwise it'd not shown since 'event-skip' mechanism.
* so add 2(nsec) so that it can be 1 nsec later.
* record otherwise it'd not show since 'event-skip' mechanism.
* Therefore, add 2(nsec) so that it can be 1 nsec later.
*/
timestamp += 2;
mtdp->watch.inited = true;
Expand Down Expand Up @@ -853,8 +855,8 @@ static int record_event(struct mcount_thread_data *mtdp,
rec = (void *)(curr_buf->data + curr_buf->size);

/*
* instead of set bitfields, do the bit operations manually.
* this would be good both for performance and portability.
* instead of set bit fields, do the bit operations manually.
* this would be good for both performance and portability.
*/
rec->data = UFTRACE_EVENT | RECORD_MAGIC << 3;
rec->data += (uint64_t)event->id << 16;
Expand Down Expand Up @@ -944,8 +946,8 @@ static int record_ret_stack(struct mcount_thread_data *mtdp,
frstack->addr = mrstack->child_ip;
#else
/*
* instead of set bitfields, do the bit operations manually.
* this would be good both for performance and portability.
* instead of set bit fields, do the bit operations manually.
* this would be good for both performance and portability.
*/
rec = type | RECORD_MAGIC << 3;
rec += argbuf ? 4 : 0;
Expand Down
6 changes: 3 additions & 3 deletions libmcount/wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void mcount_rstack_reset_exception(struct mcount_thread_data *mtdp,
int idx;
struct mcount_ret_stack *rstack;

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

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

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

Expand Down