From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 64EF86EC55; Mon, 12 Jul 2021 15:35:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 64EF86EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626093353; bh=hAMf0I/sWJU1YA+aL701UN3Zv//H7Jwqly1jkhvzucI=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=jNrzOlkmxyWjtbG/2UgZnQIz2I6guGtD5ig5mHP5poH3gPYTHRqvpMa1pxCt5Ilwi I6xwmFek8Vd0k++OdAVmfLMnuvRLR5514axrCm9w78p4M8pjgLezXWczgPDQUsEYlP pWlq0RnoFXFHz0RfUBxukMz2910rsAb6D/cJkUhg= Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C7DF86EC55 for ; Mon, 12 Jul 2021 15:35:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C7DF86EC55 Received: by mail-lf1-f47.google.com with SMTP id y42so43033824lfa.3 for ; Mon, 12 Jul 2021 05:35:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=CFncwBbAS7P4Zy9VAkFvbdx/LtwFC1SMmv9ZYYG6UKQ=; b=fIcLCvNyW9EMWIx8GkbUWJVscDhXfplSCm+N40XislydASjr0RjOHwznYhH9ezS5AY pJpFGytXok5zm8eYRQFnxiDRgUy5zgz9vuQeahnMEXpJunmynYSEyyw+SLeb7DeMtcNz TsGdKD+9Zv2PDJ/4lvik/Vo9hSVnXin5NK/XBW5aWDVyU5ZY65YOtDJ1w+eXxq9SH6hP Mlnb9U8G8rfeYQxxDe7T8DcuVcowLYCDMnNkqjAE6lMjcLbKZClBHtY8JrHRKaSuvn3w JiXYWfZlwrOrAQMRoDF0EhgdNY57UOufw7dJTKhVhvOWY/Q5iODuwPYFgnApmGIcNQqU Savg== X-Gm-Message-State: AOAM533jWW0xOAwzDVeUef+tg98mu/01xlg7HOByty3tcQgxcMNk4IZ3 Axjo5HpsgQAE2fV6GkAMDG1aZWxnvFXCPA== X-Google-Smtp-Source: ABdhPJywOix1CH16AHBzsmdWUpQeMmsXL37xf42Uc2hoM+jtqm8FdICMbk7i2a7RTIroS2sRsipnsQ== X-Received: by 2002:ac2:55a7:: with SMTP id y7mr40596792lfg.179.1626093350777; Mon, 12 Jul 2021 05:35:50 -0700 (PDT) Received: from grain.localdomain ([5.18.199.94]) by smtp.gmail.com with ESMTPSA id z16sm1196513lfs.24.2021.07.12.05.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 05:35:49 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id A8B045A001E; Mon, 12 Jul 2021 15:35:48 +0300 (MSK) Date: Mon, 12 Jul 2021 15:35:48 +0300 To: Egor Elchinov via Tarantool-patches Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.7 (2021-05-04) Subject: Re: [Tarantool-patches] [PATCH v2 4/4] fiber: refactor C backtrace and add changelog X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: Egor Elchinov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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; ... The rest looks ok to me, thanks!