From: Egor Elchinov via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Cyrill Gorcunov <gorcunov@gmail.com> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH v2 4/4] fiber: refactor C backtrace and add changelog Date: Wed, 14 Jul 2021 12:42:54 +0300 [thread overview] Message-ID: <0b5a0f5b-5f0d-e8b7-35e7-b8a5894fad26@tarantool.org> (raw) In-Reply-To: <YOw3JJ6SVFAKW8hP@grain> On 12.07.2021 15:35, Cyrill Gorcunov via Tarantool-patches wrote: > On Fri, Jul 09, 2021 at 02:03:53PM +0300, Egor Elchinov via Tarantool-patches wrote: >> + >> +int >> +backtrace_proc_cache_put(unw_word_t ip, const char *name, unw_word_t offset) >> +{ >> struct proc_cache_entry *entry; >> struct mh_i64ptr_node_t node; >> mh_int_t k; >> @@ -99,39 +108,51 @@ get_proc_name(unw_cursor_t *unw_cur, unw_word_t *offset, bool skip_cache) >> if (proc_cache == NULL) { >> region_create(&cache_region, &cord()->slabc); >> proc_cache = mh_i64ptr_new(); >> - if (proc_cache == NULL) { >> - unw_get_proc_name(unw_cur, proc_name, sizeof(proc_name), >> - offset); >> - goto error; >> - } >> + if (proc_cache == NULL) >> + return -1; >> + } >> + >> + size_t size; >> + entry = region_alloc_object(&cache_region, typeof(*entry), >> + &size); >> + if (entry == NULL) >> + return -1; >> + >> + node.key = ip; >> + node.val = entry; >> + entry->offset = offset; >> + snprintf(entry->name, BACKTRACE_NAME_MAX, "%s", name); > > Please add > > entry->name[BACKTRACE_NAME_MAX - 1] = 0; > Thanks, fixed. > ... > > The rest looks ok to me, thanks! >
prev parent reply other threads:[~2021-07-14 9:43 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-09 11:03 [Tarantool-patches] [PATCH v2 0/4] fiber: introduce creation backtrace Egor Elchinov via Tarantool-patches 2021-07-09 11:03 ` [Tarantool-patches] [PATCH v2 1/4] fiber: add PoC for fiber " Egor Elchinov via Tarantool-patches 2021-07-12 11:42 ` Cyrill Gorcunov via Tarantool-patches 2021-07-09 11:03 ` [Tarantool-patches] [PATCH v2 2/4] fiber: add option and PoC for Lua parent backtrace Egor Elchinov via Tarantool-patches 2021-07-12 12:09 ` Cyrill Gorcunov via Tarantool-patches 2021-07-14 9:29 ` Egor Elchinov via Tarantool-patches 2021-07-09 11:03 ` [Tarantool-patches] [PATCH v2 3/4] fiber: refactor lua backtrace routines Egor Elchinov via Tarantool-patches 2021-07-12 12:13 ` Cyrill Gorcunov via Tarantool-patches 2021-07-14 9:42 ` Egor Elchinov via Tarantool-patches 2021-07-09 11:03 ` [Tarantool-patches] [PATCH v2 4/4] fiber: refactor C backtrace and add changelog Egor Elchinov via Tarantool-patches 2021-07-12 12:35 ` Cyrill Gorcunov via Tarantool-patches 2021-07-14 9:42 ` Egor Elchinov via Tarantool-patches [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=0b5a0f5b-5f0d-e8b7-35e7-b8a5894fad26@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=eelchinov@tarantool.org \ --cc=gorcunov@gmail.com \ --subject='Re: [Tarantool-patches] [PATCH v2 4/4] fiber: refactor C backtrace and add changelog' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox