From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 91E712C4E6 for ; Wed, 10 Oct 2018 12:39:31 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QWwpdDhO6R2d for ; Wed, 10 Oct 2018 12:39:31 -0400 (EDT) Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 4FD692C4FB for ; Wed, 10 Oct 2018 12:39:31 -0400 (EDT) From: Georgy Kirichenko Subject: [tarantool-patches] [PATCH 1/3] fiber: do not inline coro unwind function Date: Wed, 10 Oct 2018 19:39:24 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: Georgy Kirichenko Call coro_unwcontext via function pointer to protect the function from inlining. --- src/backtrace.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backtrace.cc b/src/backtrace.cc index 2512bc045..66dcc0047 100644 --- a/src/backtrace.cc +++ b/src/backtrace.cc @@ -363,12 +363,17 @@ __asm__ volatile( #endif } +typedef void (*coro_unwcontext_indirect_f)(unw_context_t *unw_context, + struct coro_context *coro_ctx); +/* Variable to process coro_unwcontext indirect call to avoid inlining. */ +static volatile coro_unwcontext_indirect_f coro_unwcontext_indirect = coro_unwcontext; + void backtrace_foreach(backtrace_cb cb, coro_context *coro_ctx, void *cb_ctx) { unw_cursor_t unw_cur; unw_context_t unw_ctx; - coro_unwcontext(&unw_ctx, coro_ctx); + coro_unwcontext_indirect(&unw_ctx, coro_ctx); unw_init_local(&unw_cur, &unw_ctx); int frame_no = 0; unw_word_t sp = 0, old_sp = 0, ip, offset; -- 2.19.1