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 BB7606EC56; Mon, 12 Jul 2021 15:36:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BB7606EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626093389; bh=IFm+ZFnFt0mBGnG0691C7hoh7A5WgLghiCGT+wZdlG4=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=vYU0Wc0BC4RBXda3C8ICdE+d/T4VYKuXc4l3r/p+x+qdu5mb9o4JBmbrqtV0tKTAI 1tBK2WkGUIrUJxDjP8+mVaBlV/s+mda976wIGB4RtHr7jg/RGw9YZwSvJ8bQ1LjP+C 4bgXLaJGWknpiIyiAPJgb/a1wIqwd6Ee/9VE/OQg= Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 C11C66EC55 for ; Mon, 12 Jul 2021 15:25:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C11C66EC55 Received: by mail-lf1-f52.google.com with SMTP id x25so30147808lfu.13 for ; Mon, 12 Jul 2021 05:25:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xuvRAHuwM+XlKuYlBx0VJaxwJCXxeM5ITYIB8gDMXek=; b=Pk2ShO/TDpV1P4cto1RdczLAVBC2+to3iajzD0v2yCM0017b9jtmoVvKLfRnuacdo1 Mz1giAkdODzJToyTypNIK3VFVJnwCa4KiCavwXIAHnKXLg6Ndl/Qd2cc9ZkPKawhLjja h88kvFtodKcaIxf10Db9Hwve/b4+hrXDEmAXfFNVPciXDN+N/oKtKMuwo2+aXd6KJKX8 Y9RDigBx40ONsSpCgkj2NCXhxo/b0RtzsuXrCDI9uRS3G2+SKffPR42oAgCNzjqirVfZ CDmnD8VWvCu8nlbr+6al7Y5fVkUK3r+bmHyCsp0Zpm9MKMgEzVJEqnVYCo5hWlQAfmqI 8WoQ== X-Gm-Message-State: AOAM532TlB+y41FhMzorJfpi8bMa0XsnFEXNChciNsMU0FMmN/NvkTI6 DG5w94HPKSl5LbNGxIs4eByq4Pf62mdtAQ== X-Google-Smtp-Source: ABdhPJzh7cn9knKcJYAAs1rbf5Z3a5WxeQx/rw0HDZyo0zxx00H3tbtQaMQAKcXBxTSO4kgnXTHfXg== X-Received: by 2002:a05:6512:94d:: with SMTP id u13mr38931122lft.625.1626092735032; Mon, 12 Jul 2021 05:25:35 -0700 (PDT) Received: from localhost.localdomain ([2a00:1370:8131:3d05:ec70:19f1:b532:2b7f]) by smtp.gmail.com with ESMTPSA id y21sm820065lfl.78.2021.07.12.05.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 05:25:34 -0700 (PDT) To: tarantool-discussions@dev.tarantool.org, imun@tarantool.org, skaplun@tarantool.org, sergos@tarantool.org Cc: Maxim Kokryashkin Date: Mon, 12 Jul 2021 15:25:32 +0300 Message-Id: <20210712122532.29086-1-max.kokryashkin@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 12 Jul 2021 15:36:27 +0300 Subject: [Tarantool-discussions] [RFC] add flamegraphs to lua platform profiler doc X-BeenThere: tarantool-discussions@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development process List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Maxim Kokryashkin via Tarantool-discussions Reply-To: Maxim Kokryashkin Errors-To: tarantool-discussions-bounces@dev.tarantool.org Sender: "Tarantool-discussions" From: Maxim Kokryashkin --- doc/rfc/781-luajit-platform-profiler.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/rfc/781-luajit-platform-profiler.md b/doc/rfc/781-luajit-platform-profiler.md index fda3d535b..74132c2d4 100644 --- a/doc/rfc/781-luajit-platform-profiler.md +++ b/doc/rfc/781-luajit-platform-profiler.md @@ -14,6 +14,17 @@ Currently, available options for profiling LuaJIT are not fine enough to get an To get a detailed perspective of platform performance, a more advanced profiler is needed. The desired profiler must be able to capture both guest and host stacks simultaneously, along with virtual machine states. +To get the difference, you can take a look at flamegraphs generated by pref, jit.p, and PoC for the proposed profiler below. +### jit.p +![jit.p](https://i.imgur.com/sDZZDZx.png) + +### perf +![perf](https://i.imgur.com/DlKbFpo.png) + +### sysprof +![sysprof](https://i.imgur.com/Yf80MDE.png) + + ## Detailed design The proposed approach is to extend existing profiler embedded into LuaJIT, so it will be able to capture host stack too. @@ -69,4 +80,4 @@ Another way to implement such a thing is to make perf to see guest stack. To do Stack unwinding from outside of the LuaJIT is the problem we didn’t manage to solve for today. There are different approaches to do this: - *Save rsp register value to rbp and preserve rbp.* However, LuaJIT uses rbp as a general-purpose register, and it is hard not to break everything trying to use it only for stack frames. - *Coordinated work of `jit.p` and perf.* This approach requires modifying perf the way it will send LuaJIT suspension signal, and after getting info about the host stack, it will receive information about the guest stack and join them. This solution is quite possible, but modified perf doesn't seem like a production-ready solution. -- *Dwarf unwinding* \ No newline at end of file +- *Dwarf unwinding* -- 2.32.0