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 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF9AEC433EF for ; Wed, 23 Mar 2022 18:05:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 82ED183F8F; Wed, 23 Mar 2022 19:05:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VBWTwkzP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1882083F73; Wed, 23 Mar 2022 19:05:09 +0100 (CET) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CD92B83F89 for ; Wed, 23 Mar 2022 19:05:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x730.google.com with SMTP id d142so1707629qkc.4 for ; Wed, 23 Mar 2022 11:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=s35U+KAy/rFB5ChY0Rjzd7gHeNgtdxOQ12ukdHpOo64=; b=VBWTwkzPp0JuV2L/EjJ4LHQpKs0NgQIbEiWVrbTh1uZx+ZbDLyAz8CNbyQiyCboqFX fgyOs97sJr+YcP6UJhZDl5JZuISqcXfMBpteQrei9e6WMaSs4qPAm9NpcKN4lY0EFSH2 bnOerX10RP823yFDRTXraYJ7W3MCiKxIg2ztliv7TfXzBeh7bozxDDtx/nwF2uLusvEq Q5FfkNJd/N0r+lBew1oDTTBj79uR+Pw6vruc5fspUc6DhKy6IBOcIY6UdNXmcRID4cpU a4DxlhSeR8gUekZZFQNCKNDYTcsF/f9NQBLbDhR6f8W7fXJ5Bk5CB70YiJ+NfrhpRcOn PHoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=s35U+KAy/rFB5ChY0Rjzd7gHeNgtdxOQ12ukdHpOo64=; b=YC4bfJkStRDeC53fLCjHClnRAW/ITrIyo/ioS6cs6L53Vhvsy9DGk9VaQ7GjGUdRG5 Oe/FFS6UXwv0NsYd9286dkyciy1DIEe3idHSS6D2IvYZlQNLJBmnoPfLKkzOHrJXuwHq cC8sz/xJNr6puvv76O7byOrTuZ3EyL0Kan1sFxmvV0lv/HQEBskOJZ+c9sZliIpyk4/z EaLRXk06pCRQAbI6myXzvjj10yNtSCz2B//3dL3tVCYmehU9oJBXRqXrrkngi3O/jvdc i9KbXtdikR0BOYObvrv4Ajt1+V+s5JNrK3vwLml41IZzjsoPG1F4hFjO5q/fcgrSu3O1 se2Q== X-Gm-Message-State: AOAM531F20Vdsz9qS13DLT7I96cVrj05vcHcEPgIoQ955rxrnjPzWp7F ExE140O1K/6FJnCdB827sVY= X-Google-Smtp-Source: ABdhPJxC5mOc4Q071AWLpasc4eYlfcyRcs/6gMuf4s0cWftCpvQgWWMA+ftWp56XikyM3IjpZWLnlQ== X-Received: by 2002:a05:620a:290a:b0:680:9c1a:557c with SMTP id m10-20020a05620a290a00b006809c1a557cmr791029qkp.156.1648058701554; Wed, 23 Mar 2022 11:05:01 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-18-137-133.washdc.fios.verizon.net. [108.18.137.133]) by smtp.gmail.com with ESMTPSA id v9-20020a05620a0a8900b0067db9cc46a9sm314122qkg.62.2022.03.23.11.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 11:05:00 -0700 (PDT) From: Sean Anderson To: Tom Rini , u-boot@lists.denx.de Cc: Heinrich Schuchardt , Simon Glass , Sean Anderson Subject: [PATCH v3 0/3] malloc: Enable profiling dlmalloc with valgrind Date: Wed, 23 Mar 2022 14:04:47 -0400 Message-Id: <20220323180451.48950-1-seanga2@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean This series adds support for running valgrind against U-Boot's internal malloc. This allows for much more useful reports to be generated. Some example output of valgrind run against u-boot/master with this branch applied may be found at [1]. Note that valgrind gives up around acpi. This feature still needs a lot of work on suppressions/hints to filter out the noise properly. [1] https://gist.githubusercontent.com/Forty-Bot/199bf06f9cdd6871e54f8f484c16e111/raw/2a2f99108eef84b48e27a54332f3f71f4e2e5342/gistfile1.txt Changes in v3: - Fix some warnings by converting some macros to use VALGRIND_DO_CLIENT_REQUEST_STMT - Fix an additional rEALLOc branch missing VALGRIND_RESIZEINPLACE_BLOCK Changes in v2: - Fix one branch of rEALLOc missing a VALGRIND_*_BLOCK call - Add some additional suppressions for cALLOc and rEALLOc - Simplify calloc clearing logic - Drop incorrect sbrk patch Sean Anderson (3): Add valgrind headers to U-Boot malloc: Annotate allocator for valgrind doc: sandbox: Document how to run sandbox with valgrind Kconfig | 14 + Licenses/README | 1 + Licenses/bzip2-1.0.6.txt | 30 + common/dlmalloc.c | 31 +- common/malloc_simple.c | 10 + doc/arch/sandbox.rst | 14 +- include/malloc.h | 4 + include/valgrind/memcheck.h | 251 ++ include/valgrind/valgrind.h | 7106 +++++++++++++++++++++++++++++++++++ scripts/u-boot.supp | 53 + 10 files changed, 7509 insertions(+), 5 deletions(-) create mode 100644 Licenses/bzip2-1.0.6.txt create mode 100644 include/valgrind/memcheck.h create mode 100644 include/valgrind/valgrind.h create mode 100644 scripts/u-boot.supp -- 2.35.1