From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 46A5C42D4B for ; Sun, 25 Jun 2023 16:51:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 390AD40ED8; Sun, 25 Jun 2023 16:51:08 +0200 (CEST) Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) by mails.dpdk.org (Postfix) with ESMTP id 7AC7240A7F for ; Sun, 25 Jun 2023 16:51:06 +0200 (CEST) Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-341cb9528f5so12169525ab.1 for ; Sun, 25 Jun 2023 07:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1687704666; x=1690296666; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=QcJJDj+2t6faIv6Ow6H209fcbr1LFyJ/ZnQpLn4h1HE=; b=3JITSHZRn9TV0ml7F3FjuQIGGFBcSVAjqxAmzckTnk18SZGoMyPGGw7r4pvcX9ZAfq cSv1yxmNWMtAkbOxrMtE7bcDSdQokLTGTYgQaaJTZH6U9aJWb9hEBMv570Q6APLACulO KOX1o5kq0VN3XZ0S3HR0TT5Ec4JzIHE3epM6obI+W1NUPC79X9aSVVnRYYfT418VSj/8 wuM3j00QQgv/tRJyGbQnA9xkW7/dEi+Yu9pSz7H2Kf7AVC+nY4bTNbVK/+GnA2nGEAgw p6YPuFLbUwtvEm2L7fyJlwQx1KKMAzEZRmTeocTxyawOcVkKjid1whCIfnf2jUhsa4py cF3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687704666; x=1690296666; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QcJJDj+2t6faIv6Ow6H209fcbr1LFyJ/ZnQpLn4h1HE=; b=lOeEHUylzcRg6EH1W4XU0CIf5Z9zQpGQmXXPQPp5BUlaJZta85KLcyKDN5X8Ozdhki FdSt1ZVW9MOLXvBIhCQwx/2nL02+4G2vKLlQWfiHxlcdJWepEkJK2i2Y/hFS7A25J0Xg 3eaAHD7q6QJ+SIUzu0qtc1NM0rAwOIumHl9lQ+hzE6bTg0pIQWSTyYBRFKLiulKWlFht +1qWIEQuBYRs+YbeWz+syLKwSWrHx1HFoeqaw2rsYufCRt5Q3xPYRLCzk1EmbT8Avjsf umD497J/cqKFSmOrBAC4xg6WSjX98gEwjchWW2v62PkBPIDh0+XAgwfwCRfsIbtvZFMS J6hQ== X-Gm-Message-State: AC+VfDxDm/TgW1U4siVo4LTYRnHSXAWGEiGa3SzUuHUf9FwkSX+8c4XW 6zl8Sr/Y/JT/MIsbIbtJdixPfWP5kkFxKfwG8r8C5w== X-Google-Smtp-Source: ACHHUZ5IPERytLVR+okgmPHo4wY4aAAQoJyeRschpDrw1Qtlh1bxIFTBgGsn6RIHGB9WU5NwHHDxyA== X-Received: by 2002:a92:d4c8:0:b0:33f:d628:5627 with SMTP id o8-20020a92d4c8000000b0033fd6285627mr24921550ilm.0.1687704665859; Sun, 25 Jun 2023 07:51:05 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id j5-20020a62b605000000b00640f51801e6sm2322062pff.159.2023.06.25.07.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jun 2023 07:51:05 -0700 (PDT) Date: Sun, 25 Jun 2023 07:51:03 -0700 From: Stephen Hemminger To: Dmitry Kozlyuk Cc: =?UTF-8?B?THVrw6HFoSDFoGnFoW1pxaE=?= , users@dpdk.org Subject: Re: Wrapping DPDK log messages with an application logger Message-ID: <20230625075103.6dfcab6c@hermes.local> In-Reply-To: <20230622190825.57eebf75@sovereign> References: <8575de3e-d63f-f4c6-dd15-92e576c622f6@cesnet.cz> <20230622190825.57eebf75@sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org On Thu, 22 Jun 2023 19:08:25 +0300 Dmitry Kozlyuk wrote: > Hi, >=20 > 2023-06-22 17:45 (UTC+0200), Luk=C3=A1=C5=A1 =C5=A0i=C5=A1mi=C5=A1: > > I would think there could be opportunity to pass my logging callback i= nto > > DPDK but I have not found it. =20 >=20 > FWIW, I too think a callback would be better than what DPDK offers now, > because FILE* argument in rte_openlog_stream() is specific to C (libc). >=20 > > The only thing that I found was setting the stream (rte_openlog_stream(= )). =20 >=20 > Correct, this is what you're supposed to use. >=20 > > So I think I could use a Linux pipe to which DPDK would write to and th= e=20 > > application would read the contents of it, parsing it into messages and= =20 > > logging it with the application logger. =20 >=20 > > Is there any alternative solution? =20 >=20 > https://man7.org/linux/man-pages/man3/fopencookie.3.html >=20 > It's effectively a way to pass the callback you want, just wrapped in a F= ILE*. I have use fopencookie and rte_logstream to handle this in the past. Probably the code is still there in Danos and other projects.