From patchwork Wed Jun 5 22:18:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 1364 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A2F763B17 for ; Thu, 6 Jun 2019 00:18:30 +0200 (CEST) Received: from localhost.localdomain (unknown [96.44.9.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5BBE62D1; Thu, 6 Jun 2019 00:18:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1559773109; bh=PJPujODM+mZEHea8RunfQ7+YGDTZ/WytjuNJ9SWA8c8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f1eFeDElaNkD682FjfsGxhdGJcUrwwmkdU/flO23cbw4rgCAZRVgs5KdmjMpjNtPo o+yOoyDM43WsnMpIgMbEKaQfIiCEivyrMwBKKXUCbPFO8O7iOYtttF5zJNC9e1sgv1 J+bXsozQdIMl87/VSM1toZiYHlV+MOiuMeE0MDPk= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Wed, 5 Jun 2019 18:18:10 -0400 Message-Id: <20190605221817.966-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190605221817.966-1-paul.elder@ideasonboard.com> References: <20190605221817.966-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 03/10] libcamera: ipa_module: add loading error messages X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2019 22:18:30 -0000 Currently, if an IPAModule fails to be constructed due to size mismatch of struct IPAModuleInfo, the error is simply "symbol not found". Add an error message to say that the symbol is found, but not valid. Also add an error message to tell, if an IPA module failed to load, the path to the IPA module shared object that was attempted to be loaded. Signed-off-by: Paul Elder --- src/libcamera/ipa_module.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp index e1d4b27..84c77f7 100644 --- a/src/libcamera/ipa_module.cpp +++ b/src/libcamera/ipa_module.cpp @@ -145,6 +145,12 @@ int elfLoadSymbol(void *dst, size_t size, void *map, size_t soSize, targetSymbol = sym; break; } + + if (!strcmp(name, symbol)) { + LOG(IPAModule, Error) + << "Symbol " << symbol + << " found, but not valid. Check module version."; + } } if (targetSymbol == nullptr) { @@ -286,6 +292,12 @@ int IPAModule::loadIPAModuleInfo() ret = -EINVAL; } + if (ret) + LOG(IPAModule, Error) + << "Error loading IPA module at " + << libPath_; + + unmap: munmap(map, soSize); close: