* [dpdk-dev] [PATCH] eal: add log to print dpdk version at start
@ 2021-09-01 6:18 Aman Singh
2021-09-01 6:55 ` Andrew Rybchenko
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Aman Singh @ 2021-09-01 6:18 UTC (permalink / raw)
To: dev
From the logs it is difficult to get the DPDK version
that was used. So added a debug log to print the same.
The log has been added in eal_init so it gets printed
at startup for any application.
Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
---
lib/eal/freebsd/eal.c | 2 +-
lib/eal/linux/eal.c | 2 +-
lib/eal/windows/eal.c | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 6cee5ae369..a14a205f4d 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -958,7 +958,7 @@ rte_eal_init(int argc, char **argv)
}
eal_mcfg_complete();
-
+ rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
return fctret;
}
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 3577eaeaa4..a50960cc78 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1332,7 +1332,7 @@ rte_eal_init(int argc, char **argv)
}
eal_mcfg_complete();
-
+ rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
return fctret;
}
diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
index 3d8c520412..5e6d5d8930 100644
--- a/lib/eal/windows/eal.c
+++ b/lib/eal/windows/eal.c
@@ -419,6 +419,7 @@ rte_eal_init(int argc, char **argv)
*/
rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
+ rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
return fctret;
}
--
2.17.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: add log to print dpdk version at start
2021-09-01 6:18 [dpdk-dev] [PATCH] eal: add log to print dpdk version at start Aman Singh
@ 2021-09-01 6:55 ` Andrew Rybchenko
2021-09-01 9:14 ` Bruce Richardson
2021-09-01 17:12 ` Stephen Hemminger
2 siblings, 0 replies; 8+ messages in thread
From: Andrew Rybchenko @ 2021-09-01 6:55 UTC (permalink / raw)
To: Aman Singh, dev
On 9/1/21 9:18 AM, Aman Singh wrote:
>>From the logs it is difficult to get the DPDK version
> that was used. So added a debug log to print the same.
> The log has been added in eal_init so it gets printed
> at startup for any application.
>
> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
> ---
> lib/eal/freebsd/eal.c | 2 +-
> lib/eal/linux/eal.c | 2 +-
> lib/eal/windows/eal.c | 1 +
> 3 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> index 6cee5ae369..a14a205f4d 100644
> --- a/lib/eal/freebsd/eal.c
> +++ b/lib/eal/freebsd/eal.c
> @@ -958,7 +958,7 @@ rte_eal_init(int argc, char **argv)
> }
>
> eal_mcfg_complete();
> -
> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
I'd say that it should be logged as the very first message.
I'd consider INFO or even NOTICE level for the message.
INFO if we don't want to see it by default.
NOTICE if we want. I'd vote for the notice.
May be a bit out of topic, but I'm a bit surprised that
there is no common entry point for all OS and it is required
to make it in 3 places.
> return fctret;
> }
>
> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
> index 3577eaeaa4..a50960cc78 100644
> --- a/lib/eal/linux/eal.c
> +++ b/lib/eal/linux/eal.c
> @@ -1332,7 +1332,7 @@ rte_eal_init(int argc, char **argv)
> }
>
> eal_mcfg_complete();
> -
> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
> return fctret;
> }
>
> diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
> index 3d8c520412..5e6d5d8930 100644
> --- a/lib/eal/windows/eal.c
> +++ b/lib/eal/windows/eal.c
> @@ -419,6 +419,7 @@ rte_eal_init(int argc, char **argv)
> */
> rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
> rte_eal_mp_wait_lcore();
> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
> return fctret;
> }
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: add log to print dpdk version at start
2021-09-01 6:18 [dpdk-dev] [PATCH] eal: add log to print dpdk version at start Aman Singh
2021-09-01 6:55 ` Andrew Rybchenko
@ 2021-09-01 9:14 ` Bruce Richardson
2021-09-02 10:02 ` Ferruh Yigit
2021-09-01 17:12 ` Stephen Hemminger
2 siblings, 1 reply; 8+ messages in thread
From: Bruce Richardson @ 2021-09-01 9:14 UTC (permalink / raw)
To: Aman Singh; +Cc: dev
On Wed, Sep 01, 2021 at 11:48:21AM +0530, Aman Singh wrote:
> From the logs it is difficult to get the DPDK version
> that was used. So added a debug log to print the same.
> The log has been added in eal_init so it gets printed
> at startup for any application.
>
> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
> ---
> lib/eal/freebsd/eal.c | 2 +-
> lib/eal/linux/eal.c | 2 +-
> lib/eal/windows/eal.c | 1 +
> 3 files changed, 3 insertions(+), 2 deletions(-)
>
Note: EAL already has the "-v" flag which prints the version number at startup.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: add log to print dpdk version at start
2021-09-01 6:18 [dpdk-dev] [PATCH] eal: add log to print dpdk version at start Aman Singh
2021-09-01 6:55 ` Andrew Rybchenko
2021-09-01 9:14 ` Bruce Richardson
@ 2021-09-01 17:12 ` Stephen Hemminger
2021-09-02 10:11 ` Ferruh Yigit
2 siblings, 1 reply; 8+ messages in thread
From: Stephen Hemminger @ 2021-09-01 17:12 UTC (permalink / raw)
To: Aman Singh; +Cc: dev
On Wed, 1 Sep 2021 11:48:21 +0530
Aman Singh <aman.deep.singh@intel.com> wrote:
> From the logs it is difficult to get the DPDK version
> that was used. So added a debug log to print the same.
> The log has been added in eal_init so it gets printed
> at startup for any application.
>
> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
> ---
> lib/eal/freebsd/eal.c | 2 +-
> lib/eal/linux/eal.c | 2 +-
> lib/eal/windows/eal.c | 1 +
> 3 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> index 6cee5ae369..a14a205f4d 100644
> --- a/lib/eal/freebsd/eal.c
> +++ b/lib/eal/freebsd/eal.c
> @@ -958,7 +958,7 @@ rte_eal_init(int argc, char **argv)
> }
>
> eal_mcfg_complete();
> -
> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
> return fctret;
> }
>
> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
> index 3577eaeaa4..a50960cc78 100644
> --- a/lib/eal/linux/eal.c
> +++ b/lib/eal/linux/eal.c
> @@ -1332,7 +1332,7 @@ rte_eal_init(int argc, char **argv)
> }
>
> eal_mcfg_complete();
> -
> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
> return fctret;
> }
>
> diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
> index 3d8c520412..5e6d5d8930 100644
> --- a/lib/eal/windows/eal.c
> +++ b/lib/eal/windows/eal.c
> @@ -419,6 +419,7 @@ rte_eal_init(int argc, char **argv)
> */
> rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
> rte_eal_mp_wait_lcore();
> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
> return fctret;
> }
>
NAK
DPDK is already too chatty at startup.
If your application needs it then do-it-yourself.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: add log to print dpdk version at start
2021-09-01 9:14 ` Bruce Richardson
@ 2021-09-02 10:02 ` Ferruh Yigit
0 siblings, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2021-09-02 10:02 UTC (permalink / raw)
To: Bruce Richardson, Aman Singh; +Cc: dev
On 9/1/2021 10:14 AM, Bruce Richardson wrote:
> On Wed, Sep 01, 2021 at 11:48:21AM +0530, Aman Singh wrote:
>> From the logs it is difficult to get the DPDK version
>> that was used. So added a debug log to print the same.
>> The log has been added in eal_init so it gets printed
>> at startup for any application.
>>
>> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
>> ---
>> lib/eal/freebsd/eal.c | 2 +-
>> lib/eal/linux/eal.c | 2 +-
>> lib/eal/windows/eal.c | 1 +
>> 3 files changed, 3 insertions(+), 2 deletions(-)
>>
> Note: EAL already has the "-v" flag which prints the version number at startup.
>
More common usage is when -v (--version) is provided app prints the version and
exits.
No strong opinion but it is possible to have the version output always as debug,
and convert '-v' to log and exit.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: add log to print dpdk version at start
2021-09-01 17:12 ` Stephen Hemminger
@ 2021-09-02 10:11 ` Ferruh Yigit
2021-09-02 10:27 ` Bruce Richardson
0 siblings, 1 reply; 8+ messages in thread
From: Ferruh Yigit @ 2021-09-02 10:11 UTC (permalink / raw)
To: Stephen Hemminger, Aman Singh; +Cc: dev
On 9/1/2021 6:12 PM, Stephen Hemminger wrote:
> On Wed, 1 Sep 2021 11:48:21 +0530
> Aman Singh <aman.deep.singh@intel.com> wrote:
>
>> From the logs it is difficult to get the DPDK version
>> that was used. So added a debug log to print the same.
>> The log has been added in eal_init so it gets printed
>> at startup for any application.
>>
>> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
>> ---
>> lib/eal/freebsd/eal.c | 2 +-
>> lib/eal/linux/eal.c | 2 +-
>> lib/eal/windows/eal.c | 1 +
>> 3 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
>> index 6cee5ae369..a14a205f4d 100644
>> --- a/lib/eal/freebsd/eal.c
>> +++ b/lib/eal/freebsd/eal.c
>> @@ -958,7 +958,7 @@ rte_eal_init(int argc, char **argv)
>> }
>>
>> eal_mcfg_complete();
>> -
>> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
>> return fctret;
>> }
>>
>> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
>> index 3577eaeaa4..a50960cc78 100644
>> --- a/lib/eal/linux/eal.c
>> +++ b/lib/eal/linux/eal.c
>> @@ -1332,7 +1332,7 @@ rte_eal_init(int argc, char **argv)
>> }
>>
>> eal_mcfg_complete();
>> -
>> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
>> return fctret;
>> }
>>
>> diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
>> index 3d8c520412..5e6d5d8930 100644
>> --- a/lib/eal/windows/eal.c
>> +++ b/lib/eal/windows/eal.c
>> @@ -419,6 +419,7 @@ rte_eal_init(int argc, char **argv)
>> */
>> rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
>> rte_eal_mp_wait_lcore();
>> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
>> return fctret;
>> }
>>
>
> NAK
> DPDK is already too chatty at startup.
>
Is it better if the log is 'debug', so it won't be visible by default?
This can be useful to support customers, sometimes when there are multiple
binaries around, it is hard to say version of them.
As Bruce reminded, '-v' eal option provides this feature, which is better than
nothing, but it is not as useful if you are looking to an old log without actual
binary.
> If your application needs it then do-it-yourself.
>
Application may have its own versioning, which can be unrelated to the DPDK
version numbers, this can be useful to get just DPDK version.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: add log to print dpdk version at start
2021-09-02 10:11 ` Ferruh Yigit
@ 2021-09-02 10:27 ` Bruce Richardson
2021-09-06 13:28 ` Singh, Aman Deep
0 siblings, 1 reply; 8+ messages in thread
From: Bruce Richardson @ 2021-09-02 10:27 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Stephen Hemminger, Aman Singh, dev
On Thu, Sep 02, 2021 at 11:11:39AM +0100, Ferruh Yigit wrote:
> On 9/1/2021 6:12 PM, Stephen Hemminger wrote:
> > On Wed, 1 Sep 2021 11:48:21 +0530
> > Aman Singh <aman.deep.singh@intel.com> wrote:
> >
> >> From the logs it is difficult to get the DPDK version
> >> that was used. So added a debug log to print the same.
> >> The log has been added in eal_init so it gets printed
> >> at startup for any application.
> >>
> >> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
> >> ---
> >> lib/eal/freebsd/eal.c | 2 +-
> >> lib/eal/linux/eal.c | 2 +-
> >> lib/eal/windows/eal.c | 1 +
> >> 3 files changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> >> index 6cee5ae369..a14a205f4d 100644
> >> --- a/lib/eal/freebsd/eal.c
> >> +++ b/lib/eal/freebsd/eal.c
> >> @@ -958,7 +958,7 @@ rte_eal_init(int argc, char **argv)
> >> }
> >>
> >> eal_mcfg_complete();
> >> -
> >> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
> >> return fctret;
> >> }
> >>
> >> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
> >> index 3577eaeaa4..a50960cc78 100644
> >> --- a/lib/eal/linux/eal.c
> >> +++ b/lib/eal/linux/eal.c
> >> @@ -1332,7 +1332,7 @@ rte_eal_init(int argc, char **argv)
> >> }
> >>
> >> eal_mcfg_complete();
> >> -
> >> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
> >> return fctret;
> >> }
> >>
> >> diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
> >> index 3d8c520412..5e6d5d8930 100644
> >> --- a/lib/eal/windows/eal.c
> >> +++ b/lib/eal/windows/eal.c
> >> @@ -419,6 +419,7 @@ rte_eal_init(int argc, char **argv)
> >> */
> >> rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
> >> rte_eal_mp_wait_lcore();
> >> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
> >> return fctret;
> >> }
> >>
> >
> > NAK
> > DPDK is already too chatty at startup.
> >
> Is it better if the log is 'debug', so it won't be visible by default?
> This can be useful to support customers, sometimes when there are multiple
> binaries around, it is hard to say version of them.
> As Bruce reminded, '-v' eal option provides this feature, which is better than
> nothing, but it is not as useful if you are looking to an old log without actual
> binary.
>
> > If your application needs it then do-it-yourself.
> >
>
> Application may have its own versioning, which can be unrelated to the DPDK
> version numbers, this can be useful to get just DPDK version.
I'd also point out that if you have a currently running DPDK binary and
want to know the DPDK version number, just connect to the telemetry socket
and it will tell you e.g.
$ echo "quit" | sudo ./usertools/dpdk-telemetry.py
Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2
{"version": "DPDK 21.11.0-rc0", "pid": 134894, "max_output_len": 16384}
-->
$
/Bruce
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: add log to print dpdk version at start
2021-09-02 10:27 ` Bruce Richardson
@ 2021-09-06 13:28 ` Singh, Aman Deep
0 siblings, 0 replies; 8+ messages in thread
From: Singh, Aman Deep @ 2021-09-06 13:28 UTC (permalink / raw)
To: Bruce Richardson, Ferruh Yigit; +Cc: Stephen Hemminger, dev
On 9/2/2021 3:57 PM, Bruce Richardson wrote:
> On Thu, Sep 02, 2021 at 11:11:39AM +0100, Ferruh Yigit wrote:
>> On 9/1/2021 6:12 PM, Stephen Hemminger wrote:
>>> On Wed, 1 Sep 2021 11:48:21 +0530
>>> Aman Singh <aman.deep.singh@intel.com> wrote:
>>>
>>>> From the logs it is difficult to get the DPDK version
>>>> that was used. So added a debug log to print the same.
>>>> The log has been added in eal_init so it gets printed
>>>> at startup for any application.
>>>>
>>>> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
>>>> ---
>>>> lib/eal/freebsd/eal.c | 2 +-
>>>> lib/eal/linux/eal.c | 2 +-
>>>> lib/eal/windows/eal.c | 1 +
>>>> 3 files changed, 3 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
>>>> index 6cee5ae369..a14a205f4d 100644
>>>> --- a/lib/eal/freebsd/eal.c
>>>> +++ b/lib/eal/freebsd/eal.c
>>>> @@ -958,7 +958,7 @@ rte_eal_init(int argc, char **argv)
>>>> }
>>>>
>>>> eal_mcfg_complete();
>>>> -
>>>> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
>>>> return fctret;
>>>> }
>>>>
>>>> diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
>>>> index 3577eaeaa4..a50960cc78 100644
>>>> --- a/lib/eal/linux/eal.c
>>>> +++ b/lib/eal/linux/eal.c
>>>> @@ -1332,7 +1332,7 @@ rte_eal_init(int argc, char **argv)
>>>> }
>>>>
>>>> eal_mcfg_complete();
>>>> -
>>>> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
>>>> return fctret;
>>>> }
>>>>
>>>> diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c
>>>> index 3d8c520412..5e6d5d8930 100644
>>>> --- a/lib/eal/windows/eal.c
>>>> +++ b/lib/eal/windows/eal.c
>>>> @@ -419,6 +419,7 @@ rte_eal_init(int argc, char **argv)
>>>> */
>>>> rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
>>>> rte_eal_mp_wait_lcore();
>>>> + rte_log(RTE_LOG_DEBUG, RTE_LOGTYPE_EAL, "DPDK version: %s\n", rte_version());
>>>> return fctret;
>>>> }
>>>>
>>> NAK
>>> DPDK is already too chatty at startup.
>>>
>> Is it better if the log is 'debug', so it won't be visible by default?
>> This can be useful to support customers, sometimes when there are multiple
>> binaries around, it is hard to say version of them.
>> As Bruce reminded, '-v' eal option provides this feature, which is better than
>> nothing, but it is not as useful if you are looking to an old log without actual
>> binary.
>>
>>> If your application needs it then do-it-yourself.
>>>
>> Application may have its own versioning, which can be unrelated to the DPDK
>> version numbers, this can be useful to get just DPDK version.
> I'd also point out that if you have a currently running DPDK binary and
> want to know the DPDK version number, just connect to the telemetry socket
> and it will tell you e.g.
>
> $ echo "quit" | sudo ./usertools/dpdk-telemetry.py
> Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2
> {"version": "DPDK 21.11.0-rc0", "pid": 134894, "max_output_len": 16384}
> -->
>
> $
>
>
> /Bruce
Considering the EAL "-v" option which does the same job as this patch.
Planning to drop this change for now.
Thanks
Aman
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-09-06 13:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 6:18 [dpdk-dev] [PATCH] eal: add log to print dpdk version at start Aman Singh
2021-09-01 6:55 ` Andrew Rybchenko
2021-09-01 9:14 ` Bruce Richardson
2021-09-02 10:02 ` Ferruh Yigit
2021-09-01 17:12 ` Stephen Hemminger
2021-09-02 10:11 ` Ferruh Yigit
2021-09-02 10:27 ` Bruce Richardson
2021-09-06 13:28 ` Singh, Aman Deep
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).