-
Notifications
You must be signed in to change notification settings - Fork 418
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
fix: #1858 by changing the wrong logic in update_dbg_info #1884
Conversation
7eae12e
to
c9fa998
Compare
Thanks very much for the fix! Could you please update the commit message following our commit message convention? The current commit title is too long and we tend to make the title and commit message short. Please read the discussion at https://stackoverflow.com/questions/2290016/git-commit-messages-50-72-formatting. |
c9fa998
to
23fa078
Compare
Done, and do we need to add |
Thanks. But I just found that the root cause is in different reason. The following would be more proper fix. diff --git a/python/trace-python.c b/python/trace-python.c
index a0636b35..f6adc490 100644
--- a/python/trace-python.c
+++ b/python/trace-python.c
@@ -382,7 +382,7 @@ static void update_dbg_info(const char *name, uint64_t addr, const char *file, i
old_hdr.val = tmp_hdr.val;
}
- if (new_hdr.offset >= uftrace_symtab_size) {
+ if (new_hdr.offset >= uftrace_dbginfo_size) {
unsigned new_dbginfo_size = uftrace_dbginfo_size + UFTRACE_PYTHON_SYMTAB_SIZE;
pr_dbg("try to increase the shared memory for %s (new size=%uMB)\n", I think the original code at |
We also need to be sure that |
nice catch, will change the root cause. |
I think we do not need to consider it seems always less than UFTRACE_PYTHON_SYMTAB_SIZE
|
23fa078
to
112689d
Compare
@honggyukim you are right, the root cause it the logic, also change the logic from |
Yeah, we won't need it for both int entry_size = xasprintf(&buf, "F: %" PRIx64 " %s\nL: %d %s\n", addr, name, line, file); So please apply the
|
python/trace-python.c
Outdated
@@ -261,7 +261,7 @@ static uint32_t get_new_sym_addr(const char *name, bool is_libcall) | |||
old_hdr.val = tmp_hdr.val; | |||
} | |||
|
|||
if (new_hdr.offset >= uftrace_symtab_size) { | |||
while (new_hdr.offset >= uftrace_symtab_size) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to use while
. Please revert it back to if
.
python/trace-python.c
Outdated
@@ -382,7 +382,7 @@ static void update_dbg_info(const char *name, uint64_t addr, const char *file, i | |||
old_hdr.val = tmp_hdr.val; | |||
} | |||
|
|||
if (new_hdr.offset >= uftrace_symtab_size) { | |||
while (new_hdr.offset >= uftrace_dbginfo_size) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
nice commit message, learned that. |
FYI, |
The logic to increase uftrace_dbginfo_size should be compared with uftrace_dbginfo_size instead of uftrace_symtab_size. This looks like a mistake due to confusion with get_new_sym_addr. Fixed: namhyung#1858 Signed-off-by: Yi Hong <zouzou0208@gmail.com> Signed-off-by: Honggyu Kim <honggyu.kp@gmail.com>
112689d
to
cda6bbe
Compare
@honggyukim Done and thanks, I learn from your careful review every time, thanks again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks very much! I will wait for @namhyung's final check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix!
by changing the wrong logic in update_dbg_info
backtrace(need set follow-fork-mode child)