From patchwork Tue Apr 3 17:23:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Victor Kamensky \(kamensky\)" X-Patchwork-Id: 132775 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4070800ljb; Tue, 3 Apr 2018 10:24:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+E+c9rUhvOadFPPYOVAiRPuOlCPfuuKgg/viSvfzKL/k2HjackfwlCpTIQji7+HLxkq2Gt X-Received: by 10.101.97.15 with SMTP id z15mr9716112pgu.393.1522776247588; Tue, 03 Apr 2018 10:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522776247; cv=none; d=google.com; s=arc-20160816; b=EP2c/Us3NNPLpm5nK8f34YHzkXed/9TQHitzwuwOuv7ot02u3b99/VrOoUOuyVoD35 q7dHAhe7+DpCAPiLMdw8jC4xXCt4UVkFy6/2fwYCiJKtlKxXLT9vuPVCWb6CoSO+bz9T F+ElHWyqNmC+EghI4fzZKYPFYCUyFijOxgrkWYFYJcrk39sTPjxo8PYSaPBN0PWeWQlH FvgZYBjo0uAxo7KIrWA859kv17ltVEQtZgg6RT3QHke+uDWksRoHyFE8ZUrVI1dkj1oW y/nUVEsqIo6sgOCKROSjXDfYDYvQASFu4Qz3BWMhtW69tTaTl4bvEiFgLoecY+p6sGKT wowg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to:arc-authentication-results; bh=PWeIT51yyEIqdS/XGPpJZ8uP+h5PIDdbaHuP/OtYCBs=; b=SkdU8VY5tgu/ZGM9GTcGDOdPxfurAeuxI7D00uUs5eRrNGQ7BOXBCgdTQsDuj+LZAK 8ZH3jKpyJm9T/QP6Z+6vuqnDqNxZ7Q56zGd8zr1dVKJSBLJhyHX2sviWIfqY+xiLdDR5 AQAUcWNn/1D5euyaN3EpQLwaBWr0phfaVq2p94XIMrwz20Y1zu6QEWwl5fqGdMIxYPk0 RqmGersdk9vkEbcibUhZWRCFWLIQ2QKhZwbV3uFvRiJ8OUEoXM/PIwDQwVLS+WGGrrbt igGAjbxkm6pn/h3g+mRvZHU4H+OO4nhJkxaqC/ym8Ech4OrdIxW0cB6xMzwP4BKkXmFN BAcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cisco.com header.s=iport header.b=QGmJBnyY; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cisco.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id j26si2292401pgn.785.2018.04.03.10.24.07; Tue, 03 Apr 2018 10:24:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=fail header.i=@cisco.com header.s=iport header.b=QGmJBnyY; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cisco.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 8EE8274A2D; Tue, 3 Apr 2018 17:24:05 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74]) by mail.openembedded.org (Postfix) with ESMTP id 82E0274A40 for ; Tue, 3 Apr 2018 17:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2170; q=dns/txt; s=iport; t=1522776233; x=1523985833; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=ovLWzsuKnlbTrNqV+IqKBRwlFLL2jPurgtIfzFLIzF0=; b=QGmJBnyYEEc17St+z8zfWAYM4Kd65OxzIt4alaHl1+NaXyhZgpN0rY06 yeF+vz7XRHyOsQlyocnvDoIuKcS6ExkVCoL4/syiTWnXSllj2byC2mEnm Bm3tos6k23DJ8jKOgUtQXzr0xqlKsWG/s7TGCKWfJCBz0IeDD8xIqsrp0 M=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AWAgBQuMNa/4cNJK1dGQEBAQEBAQEBAQEBAQcBAQEBAYNCgVAomGODA5JVgXoLhQMChEIhNRcBAgEBAQEBAQJrKIUjBnkQUVcZhQ2vT4hEgiWHYYITg1yFb4RoIAKMU4poCI4vAow1j1YCERMBgSUeATWBUk0jFYJ9kG0fMI49AQE X-IronPort-AV: E=Sophos;i="5.48,402,1517875200"; d="scan'208";a="365599748" Received: from alln-core-2.cisco.com ([173.36.13.135]) by rcdn-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 17:23:52 +0000 Received: from kamensky-w541.cisco.com ([10.82.174.186]) (authenticated bits=0) by alln-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id w33HNck1010603 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NO); Tue, 3 Apr 2018 17:23:51 GMT From: Victor Kamensky To: openembedded-core@lists.openembedded.org Date: Tue, 3 Apr 2018 10:23:33 -0700 Message-Id: <1522776217-23250-2-git-send-email-kamensky@cisco.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522776217-23250-1-git-send-email-kamensky@cisco.com> References: <1522776217-23250-1-git-send-email-kamensky@cisco.com> X-Authenticated-User: kamensky@cisco.com Cc: Alexander Kanavin Subject: [OE-core] [PATCH v2 1/5] image: add image-combined-dbg helper class X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org There is IMAGE_GEN_DEBUGFS="1" variable that enables build of additional rootfs-dbg and additional archive that contains complimentary symbols files for a given image. But the issue with this resulting directory and tarball that before use it has to be combined with original image content. It is required since all cross debugging tools like gdb, perf, and systemtap need file system that contains both target executables/libraries and their symbols. Those tools need to find executable/library first and through it debuglink note find corresponding symbols file. image-combined-dbg when added to USER_CLASSES just copies final resulting rootfs back into rootfs-dbg creating combined target and debug symbols rootfs that can be used for debugging directly. Signed-off-by: Victor Kamensky --- meta/classes/image-combined-dbg.bbclass | 9 +++++++++ meta/classes/image.bbclass | 1 + 2 files changed, 10 insertions(+) create mode 100644 meta/classes/image-combined-dbg.bbclass -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/image-combined-dbg.bbclass b/meta/classes/image-combined-dbg.bbclass new file mode 100644 index 0000000..a709adf --- /dev/null +++ b/meta/classes/image-combined-dbg.bbclass @@ -0,0 +1,9 @@ +IMAGE_PREPROCESS_COMMAND_append = " combine_dbg_image; " + +combine_dbg_image () { + if [ "$IMAGE_GEN_DEBUGFS" = "1" -a -e ${IMAGE_ROOTFS}-dbg ]; then + # copy target files into -dbg rootfs, so it can be used for + # debug purposes directly + tar -C ${IMAGE_ROOTFS} -cf - . | tar -C ${IMAGE_ROOTFS}-dbg -xf - + fi +} diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 1636eed..5ee9c55 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -268,6 +268,7 @@ fakeroot python do_image () { from oe.utils import execute_pre_post_process d.setVarFlag('REPRODUCIBLE_TIMESTAMP_ROOTFS', 'export', '1') + d.setVarFlag('IMAGE_GEN_DEBUGFS', 'export', '1') pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND") execute_pre_post_process(d, pre_process_cmds)