From patchwork Wed Nov 6 15:43:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Vuillaumier X-Patchwork-Id: 21815 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 91514BDB13 for ; Wed, 6 Nov 2024 15:42:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C22EB65431; Wed, 6 Nov 2024 16:42:46 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="a+qW9SuU"; dkim-atps=neutral Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazlp170110003.outbound.protection.outlook.com [IPv6:2a01:111:f403:c201::3]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B9EC2653C5 for ; Wed, 6 Nov 2024 16:42:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q7AgYwrB0lzynxn2HMZKc/n3GS0TSxPiD8T2RaSnn102v+HqYfBhuWpYeoIIUsgDdEb7F4UJx0UKQ5TSjBFxFCQrt7Tok48IFlprQQZdgPEMoqQAcL8c1d1hFnHKgRhUK53twSDTCHR0M8tyOx0hZhNpKZk9zLLvee5aNzO4IrT1frvRwd7t5EkkM/x/3mfA1C/k4SGq6c6KWlzoWwg5ytSFi+er9gKrkAdMHwAKwt1vyaiN/ljucJCDdVgy0zvoVrLaZyRE6v7jt2MnZ29qB+57K7PjbQhiMywxxQo8VsJKth0lWD0TGwWjXIq9SMeCa4suFKEcAun4XLal+bvhZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MkP9LJmlP0wcKn5G0BBhtsubmqsIHuSJ9mHxGyY1KGE=; b=pWVeLuM9Vzsf2nrP9J/WafJVa46EO5lilcMbbbyvHt6r9cxK3bICuZp4ofF9/8IwHcn0CbkQJ6prW+jRzk7+p0ww3H4xt8q9cw2y87U94+GjHbJYUL22X5OsMEUe6S9RTUBaRyyKqLnmg8uyndgj9J4BgXk5AcEVXv3GvyEtbHh0gEoK2ZGnTZJYxXtlQTucXSV6/TXpjXDV+lZ2tP9HedYJWT5g84pvq6YIk0C84U+qWvoCTzaUNjtxSVd8LPvL3ZXWGJTopcyAueco/nEzk96hhkARZfS6S+0Wy5UW7GcXm2SGzhRqHG9v6bD52bvDY3+Ke0mvO9M77TDzgX4HBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MkP9LJmlP0wcKn5G0BBhtsubmqsIHuSJ9mHxGyY1KGE=; b=a+qW9SuUBzdYHBbIiq5AZWGje7IEaGu1TvyxTdVzG7ZBsXjd7V6ymkZhmIDQZlDc87wVkRPm2Y363m857wZzwHYc7FL9cZ2UWnTh/Bq5GLbBTz4zYSiofvwaT2kKx6GW0E8iINUtpUvNYbBw6GtjyxLvxqdMcG4VaEIhUmirqXkYtv+fthLoOPySJQY/yRXgcDz23W3Fjqe1MybFce5IloXxthoKXnEKC48evFXrGcPIFQ8glOiJcdCeLtV+B3iJaRHpQcpk2PA3vSf+Y9+CgKPw4jcJ1Bgkd3PN1eO2oROooS+k89sC6x1SExsecpFsYUDjuMNAdcbdW+AsW6PPLw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM9PR04MB8147.eurprd04.prod.outlook.com (2603:10a6:20b:3e0::22) by DU0PR04MB9672.eurprd04.prod.outlook.com (2603:10a6:10:31d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.29; Wed, 6 Nov 2024 15:42:42 +0000 Received: from AM9PR04MB8147.eurprd04.prod.outlook.com ([fe80::eace:e980:28a4:ef8a]) by AM9PR04MB8147.eurprd04.prod.outlook.com ([fe80::eace:e980:28a4:ef8a%3]) with mapi id 15.20.8137.018; Wed, 6 Nov 2024 15:42:41 +0000 From: Julien Vuillaumier To: libcamera-devel@lists.libcamera.org Cc: Julien Vuillaumier Subject: [PATCH v1] libcamera: ipc_unixsocket: Share stdin and stdout with IPA proxy Date: Wed, 6 Nov 2024 16:43:06 +0100 Message-Id: <20241106154306.2490129-1-julien.vuillaumier@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AM0PR01CA0106.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::47) To AM9PR04MB8147.eurprd04.prod.outlook.com (2603:10a6:20b:3e0::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8147:EE_|DU0PR04MB9672:EE_ X-MS-Office365-Filtering-Correlation-Id: 46520bc4-4aa6-4114-d7bc-08dcfe79a60d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: foyJxNbTkFGR7aGJxToVg7zaLGY+eW2m7QcqimDqFR9uRXpo8S64ipJFx90Yyw/msTbvGIdcnOJwbfV6y3g3ezUA9EgWLQDUjxJrW67brWeEbyg78luDVa8U8tSgarJ8mbfjLQ0S5hiS2k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Tr9eCdXVuiNUUqQtDrJYEML8cizXbnvQnuIQZp3FcZ3eSwUC93djvG7NF9awG4qjZrVuRAoeehBopJPh00gl6sw5fDcs1m8w0ObEWtsvXJtANeOIDpb9i+t60i1Su9iqO/n0nUv7JNCHTME5EkWY06HSkCSTZjQcOnK9j4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR04MB8147.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: odKDA6UNJpln1USbUfnSzJlCBBsk0JLt8ly4Pua0akWF5R5vgWxrvBvyH9LoR9AQZVCDCYYjO620VulhsddTdddpr88QKsVku9mI2q4d2rAs3fzSMRRZe1zu/X893Eju5yCOJF1oroWT4Zo1g9YEDcqMnavvcR7hMQ6uCYPTqL2hU3TCjqCFL2i0BFiyF6doQEHWfDkH5zYa6hnEZ0wgo+kOcwI28TKB+8XBMmtdXqA8AY3cuwxtng5b2ab9pGElTjUg0WxBvIe4/VLUCkCpKVEab1KdBKizUsCD5AMZcC9FYXujRePOJGvgjjhFzvi3m3rYxI035HYO7Tj86ikKlrDtBkd0bPgBpSY0/t0/XwCfHhQzxyEzQiYPF68nyAdKaTiSS7pRGeanApxlcMeNDg1UtbKvor1N11k4efsxpqEVK1axPKIg9SpVHnNYrDwso9OvXSpzXsJHYauVDzwY7XEvlaVDCg2OY/ot5qBZwnCHeabv+T9oHaTn8t3zFFDWQikeoOo30JFT6Pj1wkorKXZ8IxY+XlwnDU/Mi6YhiChxtoPab2FVyW3MsPNtNYkjgYqBvZav/CUqrLzuGddjfmsxKOC2QBmLlDqYcIfWGDQY/pWnpWJDwGNjYXrkkejq80FaT5qMy5QUILdyCBJYiQJhywmcV7Mdrlzf75bBUrJc18ryucf9QSMW2fagPSiHDn/YzurlxUDpu/07uGYL5a/9TrcYUr1PG2dHTVjewX85Ud2RlBQP48wQxF6fxKvxqZgAHeKUJgv/iTssn2Z4VFG48NejA7WUgw9YeoY1ZWFDeVK2SZ807Yvs6XwH5jcsNvnJNXNyK86dGTxHjH6mpNBUbJ1XQU56ile+VZbqPVRjusa0OJ5SfuFninuAxMDy1QxACYMgPVqOs4YM1msYQI5XWFXiJ0lRMVL0FIntrplI9riW2ms1BmUDu9yUl124GxaTM1sulCzod248DAxx76Bvd/6bHx1OuXIaIQ3GmFz+ZGgrIhuOReFn4ICMMpbaBPK79ojFMzOTh481YDw5gpbTM3I/ENROZOCHclign/Ot1RiYQ6xCImYCtZ4ZzwJxyIKWNSsV/oWPdaO8S+Wlw/AOSwyDhbeZDMIEUXpMzVlv9pgTd4EGa0YPLPV5yyfRh6VAWGal3XILvBAx1WTVjPQOHnRQuB6vdh8SYvLhGiEJCE2oAs+u2oUr2cFwfW12yR4kwWwMUuOal+aeGo2NdxGbbpH3Hm76qTyRFL//Zg5zFgwt+oGI9vYiaTIlL+/SWUZRQYPJU1OvpBJ4E1TKJEnWH4imT0hzSWrDPIqPcjBdcVt63o64xkKS/51ZSCQ/yLqfLz0K3kxVouRUD55ZgGjYll+naXgg0DXvgf7HMNhbTlDNNW7s+eMdhszGzTq2BP8UNqRlt8E3JYqvkhAAsRo35KX69hQVTrgLspZh19aMoiES/Vr3Fo2ngjGuLmacQtGcPjNij9NeRSU7v56ZNUiHFVxsKMQjZssoPtL2ocBFN44pHWAbdeetikjDhpF61PHo743OKNTcJWNArcn5y1HTDZtKBS7HCPfNWH3tsNW8u2TNfkLQZjMQ/1Q+hsO7ln0WfOHNe2kutixE8RSI6g== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46520bc4-4aa6-4114-d7bc-08dcfe79a60d X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8147.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2024 15:42:41.1702 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yZkmRQoqyZoEftumQoCbqqT3TL+Qc/hyr08Uchl9q+kCejCc6LNW07tiyWdtj23uYZNcxrPlwbA1D0nPfX+lcg2kkEDzYgwlBs6gYf7fD+o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9672 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When IPA is running in isolated mode, at IPA process creation time all the inherited file descriptors are closed in the new process after the fork, with the exception of the file descriptor relevant to the IPC peer Unix socket. In order to enable the IPA logging in the console, add stdout and stderr to the list of file descriptors to be shared with the isolated process. Signed-off-by: Julien Vuillaumier Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- src/libcamera/ipc_pipe_unixsocket.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcamera/ipc_pipe_unixsocket.cpp b/src/libcamera/ipc_pipe_unixsocket.cpp index 668ec73b..9ca219dc 100644 --- a/src/libcamera/ipc_pipe_unixsocket.cpp +++ b/src/libcamera/ipc_pipe_unixsocket.cpp @@ -7,6 +7,7 @@ #include "libcamera/internal/ipc_pipe_unixsocket.h" +#include #include #include @@ -42,6 +43,10 @@ IPCPipeUnixSocket::IPCPipeUnixSocket(const char *ipaModulePath, args.push_back(std::to_string(fd.get())); fds.push_back(fd.get()); + /* Share stdout and stderr with the proxy for logging purpose */ + fds.push_back(STDOUT_FILENO); + fds.push_back(STDERR_FILENO); + proc_ = std::make_unique(); int ret = proc_->start(ipaProxyWorkerPath, args, fds); if (ret) {