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 8BC71595680; Mon, 21 Aug 2023 13:06:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8BC71595680 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1692612402; bh=cXVWu6xY/UkDyKstBcSjBX1EFBOMHONUUois+bVJ6UE=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=O2/aNkpOPbXEULioRYuCP9WYPch3Q/9w7Xj9RxeCEdlVJdlrAevRtOtzlQmlRu2/V p4ZT/hj3JddAqrZKuIJQDiv9ntMgu6FM9xSiLINLEQQybO9/h41I6BFtxaIM8AzCza Xdln+sd/YML77GWDTfw/a31Kzx1+h6OFpVBpT1ew= Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 327C8595680 for ; Mon, 21 Aug 2023 13:06:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 327C8595680 Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2bbad32bc79so54468341fa.0 for ; Mon, 21 Aug 2023 03:06:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692612372; x=1693217172; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KDv3HA6KKgrSkhzBty4GL9mrsY5xDFwTAIB+gosOaBw=; b=X/u65OZznKHPat3cmHtr0RWb6QoLrgb7Yuet4CAySGtWxj+Xe6YwKbmIPc0GcCQqgG nm92B5VilScKk5o0hUXEq3zT6YdJH7SOKe57Tk7nxt+1efGhLTXL1hjOiSsjvfgscdvs RK0LfZeLxp1q9Ds0GjxZjB1yuN1EExF1KbdaefsQi1fegqiFdXOw6B8KoPphI6jZ/nkG GQnob/lU7qbpezxNPym/6G97q7yc/NZOlSdr/FJdx3ANdGoaN4sbLIAHh5rWFPPq6FEQ gRti3wq+RZ81EWXjHVh2YmNhwY+Y4kZ3UBhmhZr7dbGe06/iGztMj9ECWcSSLglzmjRd 2COw== X-Gm-Message-State: AOJu0YxerBkfpz4dGWNC4GT6NvIyHsxyoiNFUic/UjwU83U4hJb89Hle lAwzcnt4TPwhI24aQa7LXoW8KDmbVV+JPSpRcQk= X-Google-Smtp-Source: AGHT+IFrOrnJQyrSCukB0SZ4tuQNxXU1FnCzNaVUQDCf9j+PmRTNH0G8sns1KBBZwHHmpjvlnDNkrg== X-Received: by 2002:a2e:3615:0:b0:2b9:acad:b4b2 with SMTP id d21-20020a2e3615000000b002b9acadb4b2mr4458407lja.6.1692612372037; Mon, 21 Aug 2023 03:06:12 -0700 (PDT) Received: from localhost.localdomain ([94.25.172.123]) by smtp.gmail.com with ESMTPSA id b18-20020a2e8952000000b002b657f10b78sm2216360ljk.58.2023.08.21.03.06.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 21 Aug 2023 03:06:11 -0700 (PDT) To: tarantool-patches@dev.tarantool.org, imun@tarantool.org, skaplun@tarantool.org, m.kokryashkin@tarantool.org Date: Mon, 21 Aug 2023 13:06:02 +0300 Message-Id: <20230821100604.61363-2-max.kokryashkin@gmail.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20230821100604.61363-1-max.kokryashkin@gmail.com> References: <20230821100604.61363-1-max.kokryashkin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit v4 1/3] sysprof: remove `split by vmstate` option 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: Maksim Kokryashkin via Tarantool-patches Reply-To: Maksim Kokryashkin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Maxim Kokryashkin The option was introduced early into the sysprof's development to provide capabilities for per-VM-state callchain visualization. However, during the sysprof's recent active in-house usage period, it became clear that performance issues associated with specific VM states (such as GC, for example) have a distinct look on a flamegraph itself, thanks to their name prefixes and their surrounding context. This option is unneeded and was never used by anybody. There is no reason to maintain it in the scope of refactoring. Needed for tarantool/tarantool#8700 --- tools/sysprof.lua | 9 +-------- tools/sysprof/collapse.lua | 10 +++------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/tools/sysprof.lua b/tools/sysprof.lua index 1afab195..22c724e9 100644 --- a/tools/sysprof.lua +++ b/tools/sysprof.lua @@ -6,8 +6,6 @@ local misc = require "sysprof.collapse" local stdout, stderr = io.stdout, io.stderr local match, gmatch = string.match, string.gmatch -local split_by_vmstate = false - -- Program options. local opt_map = {} @@ -23,15 +21,10 @@ luajit-parse-sysprof [options] sysprof.bin Supported options are: --help Show this help and exit - --split Split callchains by vmstate ]] os.exit(0) end -function opt_map.split() - split_by_vmstate = true -end - -- Print error and exit with error status. local function opterror(...) stderr:write("luajit-parse-sysprof.lua: ERROR: ", ...) @@ -103,7 +96,7 @@ local function dump(inputfile) local symbols = symtab.parse(reader) local events = sysprof.parse(reader, symbols) - local calltree = misc.collapse(events, symbols, split_by_vmstate) + local calltree = misc.collapse(events, symbols) traverse_calltree(calltree, '') diff --git a/tools/sysprof/collapse.lua b/tools/sysprof/collapse.lua index 3d83d5ea..ac5269ea 100755 --- a/tools/sysprof/collapse.lua +++ b/tools/sysprof/collapse.lua @@ -75,7 +75,7 @@ end -- merge lua and host callchains into one callchain representing -- transfer of control -local function merge(event, symbols, sep_vmst) +local function merge(event, symbols) local cc = {} for _,h_fr in pairs(event.host.callchain) do @@ -98,19 +98,15 @@ local function merge(event, symbols, sep_vmst) end - if sep_vmst == true then - table.insert(cc, { name = VMST_NAMES[event.lua.vmstate] }) - end - return cc end -- Collapse all the events into call tree -function M.collapse(events, symbols, sep_vmst) +function M.collapse(events, symbols) local root = new_node('root', false) for _,ev in pairs(events) do - local callchain = merge(ev, symbols, sep_vmst) + local callchain = merge(ev, symbols) local curr_node = root for i=#callchain,1,-1 do curr_node = insert(callchain[i].name, curr_node, false) -- 2.39.2 (Apple Git-143)