Re: [vpp-dev] Elog binary file format

2018-10-08 Thread Florin Coras
Also, take a look at c2cpel and cpeldump. The first allows you to convert log 
files to cpel files while the second converts cpel to text. 

Hope this helps, 
Florin

> On Oct 8, 2018, at 9:22 AM, Damjan Marion via Lists.Fd.Io 
>  wrote:
> 
> 
> -- 
> Damjan
> 
>> On 8 Oct 2018, at 07:37, Aleksander Djuric > > wrote:
>> 
>> Hi Everyone!
>> 
>> I am trying to parse binary ELOG file, but have no success.
>> Is there someone who know something about ELOG file format?
>> At now I'm trying to get the unix timestamp of the each event.
>> 
>> I had found small python script here:
>> https://github.com/theleos88/vpp-bench/wiki/ELOG 
>> 
>> ...but it's not work for me.
>> 
>> The event definition in my case looks like:
>> ELOG_TYPE_DECLARE (el) = {
>>   .format = "test [%d]: event",
>>   .format_args = "i4",
>> };
>> 
>> Just for test this event prints always number "234"
>> For parsing the binary log I had written the code based on the script I have 
>> mentioned above:
>> 
>> #!/usr/bin/python -d
>> import io
>> import binascii
>> import os
>> import mmap
>> import itertools
>> import struct
>> import sys
>> import time
>> infil = '/tmp/test.log'
>> def parse_int(itr, size):
>> int_str = []
>> for i in range(0,size):
>> int_str.append( next(itr))
>> d = b"".join(int_str)
>> return int(binascii.hexlify(d), 16)
>> def parse_double(itr):
>> int_str = []
>> for i in range(0,8):
>> int_str.append(next(itr))
>> d = b"".join(int_str)
>> return struct.unpack('d', d)[0]
>> if __name__ == '__main__':
>> with open(infil, 'rb') as f:
>> # memory-map the file, size 0 means whole file
>> mm = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
>> itr = iter(mm)
>> for b in itr:
>> if (b == b'@'):
>> try:
>> e = parse_int(itr, 3)   # Binary file dependent
>> d = parse_int(itr, 4)   # Data
>> ts = parse_double(itr)   # Timestamp
>>  print ("Id:",e,"Data",d,"TS",ts)
>> except:
>> print ("fail")
>> mm.close()
>> 
>> The script output looks very strange:
>> 
>> ('Id:', 12583082, 'Data', 4077750898, 'TS', -2.033971772667215e+189)
>> ('Id:', 4913710, 'Data', 234, 'TS', 6.36910374265963e-272)
>> ('Id:', 4946789, 'Data', 234, 'TS', -3.781860196468732e+215)
>> ('Id:', 4980415, 'Data', 234, 'TS', 2.8913004726712464e+252)
>> ('Id:', 5014033, 'Data', 234, 'TS', 1.0459787848697367e-194)
>> ('Id:', 5047603, 'Data', 234, 'TS', 1.8541854501616871e+87)
>> ('Id:', 5081197, 'Data', 234, 'TS', -1.9417949536011382e+216)
>> ('Id:', 5114754, 'Data', 234, 'TS', -1.1766415030126902e-236)
>> ('Id:', 5148346, 'Data', 234, 'TS', 2.805116355676246e-134)
>> ('Id:', 5181997, 'Data', 234, 'TS', 1.2734961345447485e-257)
>> fail
>> 
>> 1) It seems that the first and the last line of the log has a different 
>> format (???).
>> 2) I can't understand the format of the timestamp field (or these 8 bytes is 
>> not a timestamp).
>> 3) Data prints correctly.
>> 
>> Could anyone help me please?
>> Thanks in advance,
>> Aleksander
> 
> Looking into g2 source might be good start. g2 is GTK based elog graphical 
> viewer...
> 
> https://git.fd.io/vpp/tree/src/tools/g2 
> 
> 
> -- 
> Damjan
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> 
> View/Reply Online (#10770): https://lists.fd.io/g/vpp-dev/message/10770 
> 
> Mute This Topic: https://lists.fd.io/mt/26875131/675152 
> 
> Group Owner: vpp-dev+ow...@lists.fd.io 
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub 
>   [fcoras.li...@gmail.com 
> ]
> -=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10771): https://lists.fd.io/g/vpp-dev/message/10771
Mute This Topic: https://lists.fd.io/mt/26875131/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Elog binary file format

2018-10-08 Thread Damjan Marion via Lists.Fd.Io

-- 
Damjan

> On 8 Oct 2018, at 07:37, Aleksander Djuric  
> wrote:
> 
> Hi Everyone!
> 
> I am trying to parse binary ELOG file, but have no success.
> Is there someone who know something about ELOG file format?
> At now I'm trying to get the unix timestamp of the each event.
> 
> I had found small python script here:
> https://github.com/theleos88/vpp-bench/wiki/ELOG 
> 
> ...but it's not work for me.
> 
> The event definition in my case looks like:
> ELOG_TYPE_DECLARE (el) = {
>   .format = "test [%d]: event",
>   .format_args = "i4",
> };
> 
> Just for test this event prints always number "234"
> For parsing the binary log I had written the code based on the script I have 
> mentioned above:
> 
> #!/usr/bin/python -d
> import io
> import binascii
> import os
> import mmap
> import itertools
> import struct
> import sys
> import time
> infil = '/tmp/test.log'
> def parse_int(itr, size):
> int_str = []
> for i in range(0,size):
> int_str.append( next(itr))
> d = b"".join(int_str)
> return int(binascii.hexlify(d), 16)
> def parse_double(itr):
> int_str = []
> for i in range(0,8):
> int_str.append(next(itr))
> d = b"".join(int_str)
> return struct.unpack('d', d)[0]
> if __name__ == '__main__':
> with open(infil, 'rb') as f:
> # memory-map the file, size 0 means whole file
> mm = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
> itr = iter(mm)
> for b in itr:
> if (b == b'@'):
> try:
> e = parse_int(itr, 3)   # Binary file dependent
> d = parse_int(itr, 4)   # Data
> ts = parse_double(itr)   # Timestamp
>  print ("Id:",e,"Data",d,"TS",ts)
> except:
> print ("fail")
> mm.close()
> 
> The script output looks very strange:
> 
> ('Id:', 12583082, 'Data', 4077750898, 'TS', -2.033971772667215e+189)
> ('Id:', 4913710, 'Data', 234, 'TS', 6.36910374265963e-272)
> ('Id:', 4946789, 'Data', 234, 'TS', -3.781860196468732e+215)
> ('Id:', 4980415, 'Data', 234, 'TS', 2.8913004726712464e+252)
> ('Id:', 5014033, 'Data', 234, 'TS', 1.0459787848697367e-194)
> ('Id:', 5047603, 'Data', 234, 'TS', 1.8541854501616871e+87)
> ('Id:', 5081197, 'Data', 234, 'TS', -1.9417949536011382e+216)
> ('Id:', 5114754, 'Data', 234, 'TS', -1.1766415030126902e-236)
> ('Id:', 5148346, 'Data', 234, 'TS', 2.805116355676246e-134)
> ('Id:', 5181997, 'Data', 234, 'TS', 1.2734961345447485e-257)
> fail
> 
> 1) It seems that the first and the last line of the log has a different 
> format (???).
> 2) I can't understand the format of the timestamp field (or these 8 bytes is 
> not a timestamp).
> 3) Data prints correctly.
> 
> Could anyone help me please?
> Thanks in advance,
> Aleksander

Looking into g2 source might be good start. g2 is GTK based elog graphical 
viewer...

https://git.fd.io/vpp/tree/src/tools/g2 


-- 
Damjan

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10770): https://lists.fd.io/g/vpp-dev/message/10770
Mute This Topic: https://lists.fd.io/mt/26875131/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[vpp-dev] Elog binary file format

2018-10-08 Thread Aleksander Djuric
Hi Everyone!

I am trying to parse binary ELOG file, but have no success.
Is there someone who know something about ELOG file format?
At now I'm trying to get the unix timestamp of the each event.

I had found small python script here:
https://github.com/theleos88/vpp-bench/wiki/ELOG
...but it's not work for me.

The event definition in my case looks like:

> ELOG_TYPE_DECLARE (el) = {
>   .format = "test [%d]: event",
>   .format_args = "i4",
> };


Just for test this event prints always number "234"
For parsing the binary log I had written the code based on the script I
have mentioned above:

#!/usr/bin/python -d
> import io
> import binascii
> import os
> import mmap
> import itertools
> import struct
> import sys
> import time
> infil = '/tmp/test.log'
> def parse_int(itr, size):
> int_str = []
> for i in range(0,size):
> int_str.append( next(itr))
> d = b"".join(int_str)
> return int(binascii.hexlify(d), 16)
> def parse_double(itr):
> int_str = []
> for i in range(0,8):
> int_str.append(next(itr))
> d = b"".join(int_str)
> return struct.unpack('d', d)[0]
> if __name__ == '__main__':
> with open(infil, 'rb') as f:
> # memory-map the file, size 0 means whole file
> mm = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
> itr = iter(mm)
> for b in itr:
> if (b == b'@'):
> try:
> e = parse_int(itr, 3)   # Binary file dependent
> d = parse_int(itr, 4)   # Data
> ts = parse_double(itr)   # Timestamp
>  print ("Id:",e,"Data",d,"TS",ts)
> except:
> print ("fail")
> mm.close()


The script output looks very strange:

('Id:', 12583082, 'Data', 4077750898, 'TS', -2.033971772667215e+189)
('Id:', 4913710, 'Data', 234, 'TS', 6.36910374265963e-272)
('Id:', 4946789, 'Data', 234, 'TS', -3.781860196468732e+215)
('Id:', 4980415, 'Data', 234, 'TS', 2.8913004726712464e+252)
('Id:', 5014033, 'Data', 234, 'TS', 1.0459787848697367e-194)
('Id:', 5047603, 'Data', 234, 'TS', 1.8541854501616871e+87)
('Id:', 5081197, 'Data', 234, 'TS', -1.9417949536011382e+216)
('Id:', 5114754, 'Data', 234, 'TS', -1.1766415030126902e-236)
('Id:', 5148346, 'Data', 234, 'TS', 2.805116355676246e-134)
('Id:', 5181997, 'Data', 234, 'TS', 1.2734961345447485e-257)
fail

1) It seems that the first and the last line of the log has a different
format (???).
2) I can't understand the format of the timestamp field (or these 8 bytes
is not a timestamp).
3) Data prints correctly.

Could anyone help me please?
Thanks in advance,
Aleksander
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10769): https://lists.fd.io/g/vpp-dev/message/10769
Mute This Topic: https://lists.fd.io/mt/26875131/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] CSIT - VirtualEthernet interface UP issue

2018-10-08 Thread Juraj Sloboda -X (jsloboda - PANTHEON TECHNOLOGIES@Cisco) via Lists.Fd.Io
Hi,


The behavior was intentionally changed in 'b192feb vhost-user: Interface state 
updates'

so that link is reported in up state if and only if admin state is up and 
vhost-user slave (vpp) interface is connected to vhost-user master (qemu).

The connection state can also be inferred from output of 'show vhost-user' 
debug CLI command or using sw_interface_vhost_user_dump API call.


Regards,

Juraj Sloboda


From: csit-...@lists.fd.io  on behalf of Peter Mikus via 
Lists.Fd.Io 
Sent: Monday, October 8, 2018 10:42
To: vpp-dev@lists.fd.io
Cc: csit-...@lists.fd.io
Subject: [csit-dev] CSIT - VirtualEthernet interface UP issue

Hello vpp-dev,

Recently we are facing issue that VirtualEthernet interfaces (vhost-user) are 
not coming UP once we put them to admin UP state.


Brief bisecting reveals that its happening after one of these:

git log --pretty=oneline 0a4e006..5507192
5507192339aed14634929b3e8d7c5d3e5ea8f997 Fix JVPP enum _host_to_net_ 
translation (VPP-1438)
2d3c7b9c4555ea4467253b0590c9aa1a6c644b4d BFD: add get echo source API (VPP-1367)
a9a0b2ce2daabc5479aa7722e3ec7023f8c6c0d5 IPsec: add API for SPDs dump (VPP-1363)
b192feba004e7a52b57ff9f68246b1c94e8b667b vhost-user: Interface state updates
83c46a2c5c97320e029b4dd154a45212530f221d vhost_user: Fix setting MTU using 
uninitialized variable
8f39d55a298e08ac808da6988032f14d542627c6 Update code to compute checksum for 
buffer chains
ef91534e665cf343af2389df11d46559a1f83d78 tls: fix disconnects for sessions with 
pending data
5f5d50ee9b342964ca10612cd002497fb40c tcp: fix close wait timeout with no fin
ca09d0730974effd53b436871f3e69c8bb8b1114 tcp: accept fins if in recovery

Could you please take a look and let us know if there was any change in 
mechanics or API?


Thank you.

[0] 
https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master/333/consoleFull
 | grep VirtualEthernet
[1] VAT history:
sw_interface_set_flags sw_if_index 2 admin-up link-up
sw_interface_set_l2_bridge sw_if_index 2 bd_id 1 shg 0 enable
sw_interface_set_flags sw_if_index 1 admin-up link-up
sw_interface_set_l2_bridge sw_if_index 1 bd_id 2 shg 0 enable
create_vhost_user_if socket /tmp/sock-1-1
sw_interface_dump
sw_interface_dump
create_vhost_user_if socket /tmp/sock-1-2
sw_interface_dump
sw_interface_dump
sw_interface_set_flags sw_if_index 3 admin-up link-up
sw_interface_set_flags sw_if_index 4 admin-up link-up
sw_interface_set_flags sw_if_index 3 admin-up link-up
sw_interface_set_l2_bridge sw_if_index 3 bd_id 1 shg 0 enable
sw_interface_set_flags sw_if_index 4 admin-up link-up
sw_interface_set_l2_bridge sw_if_index 4 bd_id 2 shg 0 enable
sw_interface_dump



Peter Mikus
Engineer - Software
Cisco Systems Limited

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10768): https://lists.fd.io/g/vpp-dev/message/10768
Mute This Topic: https://lists.fd.io/mt/26872454/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[vpp-dev] CSIT - VirtualEthernet interface UP issue

2018-10-08 Thread Peter Mikus via Lists.Fd.Io
Hello vpp-dev,

Recently we are facing issue that VirtualEthernet interfaces (vhost-user) are 
not coming UP once we put them to admin UP state.


Brief bisecting reveals that its happening after one of these:

git log --pretty=oneline 0a4e006..5507192
5507192339aed14634929b3e8d7c5d3e5ea8f997 Fix JVPP enum _host_to_net_ 
translation (VPP-1438)
2d3c7b9c4555ea4467253b0590c9aa1a6c644b4d BFD: add get echo source API (VPP-1367)
a9a0b2ce2daabc5479aa7722e3ec7023f8c6c0d5 IPsec: add API for SPDs dump (VPP-1363)
b192feba004e7a52b57ff9f68246b1c94e8b667b vhost-user: Interface state updates
83c46a2c5c97320e029b4dd154a45212530f221d vhost_user: Fix setting MTU using 
uninitialized variable
8f39d55a298e08ac808da6988032f14d542627c6 Update code to compute checksum for 
buffer chains
ef91534e665cf343af2389df11d46559a1f83d78 tls: fix disconnects for sessions with 
pending data
5f5d50ee9b342964ca10612cd002497fb40c tcp: fix close wait timeout with no fin
ca09d0730974effd53b436871f3e69c8bb8b1114 tcp: accept fins if in recovery

Could you please take a look and let us know if there was any change in 
mechanics or API?


Thank you.

[0] 
https://jenkins.fd.io/view/csit/job/csit-vpp-perf-mrr-daily-master/333/consoleFull
 | grep VirtualEthernet
[1] VAT history:
sw_interface_set_flags sw_if_index 2 admin-up link-up
sw_interface_set_l2_bridge sw_if_index 2 bd_id 1 shg 0 enable
sw_interface_set_flags sw_if_index 1 admin-up link-up
sw_interface_set_l2_bridge sw_if_index 1 bd_id 2 shg 0 enable
create_vhost_user_if socket /tmp/sock-1-1
sw_interface_dump
sw_interface_dump
create_vhost_user_if socket /tmp/sock-1-2
sw_interface_dump
sw_interface_dump
sw_interface_set_flags sw_if_index 3 admin-up link-up
sw_interface_set_flags sw_if_index 4 admin-up link-up
sw_interface_set_flags sw_if_index 3 admin-up link-up
sw_interface_set_l2_bridge sw_if_index 3 bd_id 1 shg 0 enable
sw_interface_set_flags sw_if_index 4 admin-up link-up
sw_interface_set_l2_bridge sw_if_index 4 bd_id 2 shg 0 enable
sw_interface_dump



Peter Mikus
Engineer - Software
Cisco Systems Limited

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10767): https://lists.fd.io/g/vpp-dev/message/10767
Mute This Topic: https://lists.fd.io/mt/26872454/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[vpp-dev] Outstanding coverity scan warnings for 18.10

2018-10-08 Thread Marco Varlese
Dear all,

I would like to ask all of you to, please, take some time to review the
outstanding coverity scan warnings and triage them.

Areas of interest are:
* MEMIF
* NSH plugin
* VXLAN
* VXLAN-GPE
* API
* PROMETHEUS


Thanks and regards,
-- 
Marco V

SUSE LINUX GmbH | GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg) Maxfeldstr. 5, D-90409, Nürnberg

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#10766): https://lists.fd.io/g/vpp-dev/message/10766
Mute This Topic: https://lists.fd.io/mt/26872018/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-