From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,PDS_TONAME_EQ_TOLOCAL_SHORT, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F5FCC4708E for ; Sat, 29 May 2021 16:47:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D98C610CC for ; Sat, 29 May 2021 16:47:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229704AbhE2QtP (ORCPT ); Sat, 29 May 2021 12:49:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbhE2QtP (ORCPT ); Sat, 29 May 2021 12:49:15 -0400 Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B00B7C061574 for ; Sat, 29 May 2021 09:47:38 -0700 (PDT) Received: by mail-ua1-x930.google.com with SMTP id g34so3965598uah.8 for ; Sat, 29 May 2021 09:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=0VwzA6JPvBPeEZCsi58jfEN29zRlnhjydzgi3Zu7uls=; b=n16p+PprpSExCX2AmTllMtsimH1ZCTbzZ6xLL0KB5Q/uWayzRDSWBAMU/aB43DHDTf gPhMUKyG5YmSsxtIohS70LrdptrYjIqHIZCeYM3dwchorJBpg5ed0oThW/67EXkEbysj RgWG6WKT/1arMtofeEGXaxt5e9IaAii7aB0/Qr7tdGPPNXENybtuNmyKkMGKD4MkwzBU v4uasYSDp2xq6GLP45R6zpVASfDakUUzy0+SS1kQN0UZ4P7ojnd4D1CM7Woqc7fdbqHi 7OS5cNeuqMknnAGwfTPf9+3lSsJJlJcaqqUqPPKVcQDxK3LhjQXjSXQpStmIalsYtOPg whPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=0VwzA6JPvBPeEZCsi58jfEN29zRlnhjydzgi3Zu7uls=; b=cHyWdLnoIiHbV3dGgMkB49VRmJBWH0j+6zyA557aaPY2T59mlYBQiMUvZikyoDiOFR ZCRp4psbztxFXBLi98JvxXHYwouLMXj/gTsxIGi4p3Q/autnXjW2QW5J22T1PM+f05o7 EqGeAMK5ZH8nDk/hS0ThU7pWSiWM+9f6QDToGdKgrzz+lxHQGaI1YwlYhd7P3blyPVuF 6L7ssMNRxRJpog1KFVDmLTQw7Oefmmqu6BocvZO4lZ5vlAgQy8plri4ZD9IBagV+/hJf MMK8c+b1UoywcIpWMsOa5FAyOb1fCpV6y0UYJ8Ur9hU2wL14D6mF6jUGKsRDKFnPyx17 eGWg== X-Gm-Message-State: AOAM533OpIaUjlyIOXYUM1azlta/WNzH7swH/2djV4nIcbe/Z4rED7Pf xNfl+KqDS4oUxEcJcz7nbzxMgIdXDzvXew58FiZ/lzqi/08= X-Google-Smtp-Source: ABdhPJwSAQ0k+XyNhIb1NvWdEppmwRNQzouXiOtOOYY6XOkvvVOfTR+heaRJDYGZEXBH6jEI1mgiwzYKKg/6FYbOafU= X-Received: by 2002:a1f:2703:: with SMTP id n3mr4635426vkn.18.1622306857396; Sat, 29 May 2021 09:47:37 -0700 (PDT) MIME-Version: 1.0 From: Grant Seltzer Richman Date: Sat, 29 May 2021 12:47:26 -0400 Message-ID: Subject: Strategy for debugging 'Exceeded stack limit' errors To: bpf Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Hi all, I'm trying to reduce stack usage in my bpf program. I moved over to using `bpf_core_read()` instead of `bpf_probe_read()` and it appears to have made my program exceed the 512 byte stack limit. Are there any profiler tools or compiler flags I can use to figure out what is exactly using up the most memory? Additionally, does anyone have good examples they can point me to of storing structures in per_cpu maps or local storage mechanisms? Thanks so much! Grant