ldv changed the topic of #strace to: https://strace.io | https://strace.io/logs/ | strace 4.23 is out | strace-devel@lists.strace.io for dev discussions
mjw has joined #strace
pombreda has quit [Ping timeout: 260 seconds]
<zhibli> esyrd: Actually I haven't completely figured out how mpersification works.
<zhibli> Now I'm looking into 092942206c3c6c9978a96e6589b97cc4029b6d89 which is the initial commit of mpers support.
<zhibli> Like you said "why type mpersification is needed", that's exactly what I'm learning.
<esyrd> zhibli: overall, it scans all files with specific defines, generates files with type definitions, compiles them for various personalities and parses produced dwarf in order to generate type definitions that can be used in strace code.
<esyrd> mpersified files are compiled with type definitions produced for different personalities and mpersified symbols there swapped on personality change.
<esyrd> something like that.
<zhibli> Yes I found those type definitions in mpers-m32/ and mpers-mx32/ with some unsigned char mpers_filler_2[]
<zhibli> The same structure has different mpers_filler so I kinda know what you said above.
<zhibli> I'm trying to find out how this mpers_filler were added.
<esyrd> the files are generated by mpers.awk, but that's not terribly important.
<esyrd> it is added because there is padding in the structure definition.
<esyrd> *there is a hole
<esyrd> mmm, not structure definition, but the resulting structure memory layout for specific personality.
<zhibli> BTW, I've tried adding ATTRIBUTE_PACKED to struct fs_qfilestat_t but on 64 bits the tests passed so is it something wrong invisible (i.e. what will the broken alignment on 64 bits actually bring?)
<zhibli> esyrd: OK, I don't know those technical terms well but I get your point.
<zhibli> ATTRIBUTE_PACKED means compact right? I know the alignment doesn't fit on 64 bits but what it will lead to (I realize that it may be a stupid question)
<zhibli> I should focus on the tests which is the first priority O_o
<esyrd> zhibli: ATTRIBUTE_PACKED is defined in gcc_compat.h as __attribute__((__packed__)), https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html
<esyrd> zhibli: do you have quotactl-xfs.gen test skipped or passed?
<esyrd> (it's even better, because test explicitly defines padding if no defition is available)
<zhibli> esyrd: It seems all of the tests passed and I double checked quota related tests
<esyrd> that's funny.
<esyrd> wait, have you added ATTRIBUTE_PACKED to the type or the field definition?
<esyrd> yep, ATTRIBUTE_PACKED for the type definition means that struct fields are packed tightly, but doesn't affect layout of the entities of the type inside other structures.
<esyrd> zhibli: if you want to avoid padding, you need ATTRIBUTE_PACKED both for struct fs_qfilestat and struct xfs_dqstats.
<zhibli> Ah, now things seems weirder to me
<esyrd> oh, wait.
<esyrd> I don't see a test for that structure at all.
<esyrd> do you use your own tests for it?
* esyrd confused struct fs_quota_stat with struct fs_quota_statv, sorry
<esyrd> which is also called as xfs_dqstats in quota.c
<esyrd> (to make things worse)
<zhibli> Well I'm confused at the beginning, too
<esyrd> yeah, I see a commit in your branch.
<esyrd> so, Q_XGETQSTAT command is one that should be tested.
<zhibli> yes I just added quotactl-xfs-success.test and quotactl-xfs-success-v.test
<zhibli> Then the entire quotactl-xfs.c will be tested right?
<esyrd> okay, so it could only be checked by success tests, right.
<esyrd> you can check expected/generated output in tests/<testname>.dir/, btw.
<zhibli> Oh I knew it
<zhibli> before I add ATTRIBUTE_PACKED to struct fs_qfilestat the two tests above failed
<zhibli> I think it's because TAIL_ALLOC_OBJECT_CONST_PTR only allocated 68 bytes to struct xfs_dqstats on 32bit so when strace try to fetch 80 bytes it failed
<zhibli> Because decoder hasn't been mpersified yet, so it always calculates struct xfs_dqstats as an 80 bytes structure.
<zhibli> I calculate the bytes and it seems this is just a coincidence.....
<zhibli> I'm not so sure yet but sorry it's 21:05 here and I have to eat dinner.
* zhibli will be back later
pombreda has joined #strace
pombreda has quit [Ping timeout: 268 seconds]
pombreda has joined #strace
pombreda has quit [Ping timeout: 256 seconds]
pombreda has joined #strace
pombreda has quit [Ping timeout: 240 seconds]
pombreda has joined #strace
pombreda has quit [Ping timeout: 240 seconds]
pombreda has joined #strace
pombreda has quit [Ping timeout: 260 seconds]
pombreda has joined #strace
mjw has quit [Quit: Leaving]
pombreda has quit [Ping timeout: 240 seconds]
pombreda has joined #strace