Add timestamp to dpdk.log
Soumya Muralidhar
soumya.muralidhar at gigamon.com
Tue Jan 4 20:15:37 CET 2022
Hi,
I am looking to add timestamp while logging using rte_openlog_stream<https://grok.gigamon.com:8443/source/s?defs=rte_openlog_stream&project=nfv_master> function where you pass the file pointer as a parameter to this function.
Below is the snippet :
const char *dpdk_log_path<https://grok.gigamon.com:8443/source/s?refs=dpdk_log_path&project=nfv_master> = "/var<https://grok.gigamon.com:8443/source/s?path=/var/&project=nfv_master>/log<https://grok.gigamon.com:8443/source/s?path=/var/log/&project=nfv_master>/dpdk.log<https://grok.gigamon.com:8443/source/s?path=/var/log/dpdk.log&project=nfv_master>"
log_fp<https://grok.gigamon.com:8443/source/xref/nfv_master/src/ehal_lib/ehal_dpdk_binding.c?r=6c10cae5#log_fp> = fopen<https://grok.gigamon.com:8443/source/s?defs=fopen&project=nfv_master>(dpdk_log_path<https://grok.gigamon.com:8443/source/xref/nfv_master/src/ehal_lib/ehal_dpdk_binding.c?r=6c10cae5#dpdk_log_path>, "a+");
if (log_fp<https://grok.gigamon.com:8443/source/xref/nfv_master/src/ehal_lib/ehal_dpdk_binding.c?r=6c10cae5#log_fp> == NULL<https://grok.gigamon.com:8443/source/s?defs=NULL&project=nfv_master>) {
EHAL_LOG<https://grok.gigamon.com:8443/source/s?defs=EHAL_LOG&project=nfv_master>(LOG_ERR<https://grok.gigamon.com:8443/source/s?defs=LOG_ERR&project=nfv_master>, "dpdk log file(%s) open failed, error (%d:%s) ",
dpdk_log_path<https://grok.gigamon.com:8443/source/xref/nfv_master/src/ehal_lib/ehal_dpdk_binding.c?r=6c10cae5#dpdk_log_path>, errno<https://grok.gigamon.com:8443/source/s?defs=errno&project=nfv_master>, strerror<https://grok.gigamon.com:8443/source/s?defs=strerror&project=nfv_master>(errno<https://grok.gigamon.com:8443/source/s?defs=errno&project=nfv_master>));
return (errno<https://grok.gigamon.com:8443/source/s?defs=errno&project=nfv_master>);
rte_openlog_stream<https://grok.gigamon.com:8443/source/s?defs=rte_openlog_stream&project=nfv_master>(log_fp<https://grok.gigamon.com:8443/source/xref/nfv_master/src/ehal_lib/ehal_dpdk_binding.c?r=6c10cae5#log_fp>);
Thanks,
Soumya
This message may contain confidential and privileged information. If it has been sent to you in error, please reply to advise the sender of the error and then immediately delete it. If you are not the intended recipient, do not read, copy, disclose or otherwise use this message. The sender disclaims any liability for such unauthorized use. NOTE that all incoming emails sent to Gigamon email accounts will be archived and may be scanned by us and/or by external service providers to detect and prevent threats to our systems, investigate illegal or inappropriate behavior, and/or eliminate unsolicited promotional emails (“spam”).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20220104/a6697321/attachment-0001.htm>
More information about the dev
mailing list