linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* updating btrfs-debugfs to python3?
@ 2019-06-19  3:20 Chris Murphy
  2019-06-19 10:13 ` Holger Hoffstätte
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Murphy @ 2019-06-19  3:20 UTC (permalink / raw)
  To: Btrfs BTRFS

This is on Fedora Rawhide (which is planned to become Fedora 31 due in
October), which no longer provides python2.

$ ./btrfs-debugfs -b /
/usr/bin/env: ‘python2’: No such file or directory
$

I expect other distros are going to follow as Python 2.7 EOL is coming
up fast, in 6 months.
https://pythonclock.org/

-- 
Chris Murphy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: updating btrfs-debugfs to python3?
  2019-06-19  3:20 updating btrfs-debugfs to python3? Chris Murphy
@ 2019-06-19 10:13 ` Holger Hoffstätte
  2019-06-19 10:21   ` Hans van Kranenburg
  0 siblings, 1 reply; 5+ messages in thread
From: Holger Hoffstätte @ 2019-06-19 10:13 UTC (permalink / raw)
  To: Chris Murphy, Btrfs BTRFS

On 6/19/19 5:20 AM, Chris Murphy wrote:
> This is on Fedora Rawhide (which is planned to become Fedora 31 due in
> October), which no longer provides python2.
> 
> $ ./btrfs-debugfs -b /
> /usr/bin/env: ‘python2’: No such file or directory
> $
> 
> I expect other distros are going to follow as Python 2.7 EOL is coming
> up fast, in 6 months.
> https://pythonclock.org/

I just ran it through 2to3-3.7 with -w and the new version seems to work
just fine for me, so it seems there is not much porting required.

hth,
Holger

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: updating btrfs-debugfs to python3?
  2019-06-19 10:13 ` Holger Hoffstätte
@ 2019-06-19 10:21   ` Hans van Kranenburg
  2019-06-19 11:30     ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Hans van Kranenburg @ 2019-06-19 10:21 UTC (permalink / raw)
  To: Holger Hoffstätte, Chris Murphy, Btrfs BTRFS

On 6/19/19 12:13 PM, Holger Hoffstätte wrote:
> On 6/19/19 5:20 AM, Chris Murphy wrote:
>> This is on Fedora Rawhide (which is planned to become Fedora 31 due in
>> October), which no longer provides python2.
>>
>> $ ./btrfs-debugfs -b /
>> /usr/bin/env: ‘python2’: No such file or directory
>> $
>>
>> I expect other distros are going to follow as Python 2.7 EOL is coming
>> up fast, in 6 months.
>> https://pythonclock.org/
> 
> I just ran it through 2to3-3.7 with -w and the new version seems to work
> just fine for me, so it seems there is not much porting required.

I don't think you want to ship that program at all, for end users. It's
quite horrible, and the -b option even downloads the *entire* extent
tree to userspace in a very naive way.

There are way simpler, better performing alternatives...

Hans


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: updating btrfs-debugfs to python3?
  2019-06-19 10:21   ` Hans van Kranenburg
@ 2019-06-19 11:30     ` David Sterba
  2019-06-19 12:22       ` Hans van Kranenburg
  0 siblings, 1 reply; 5+ messages in thread
From: David Sterba @ 2019-06-19 11:30 UTC (permalink / raw)
  To: Hans van Kranenburg; +Cc: Holger Hoffstätte, Chris Murphy, Btrfs BTRFS

On Wed, Jun 19, 2019 at 12:21:34PM +0200, Hans van Kranenburg wrote:
> On 6/19/19 12:13 PM, Holger Hoffstätte wrote:
> > On 6/19/19 5:20 AM, Chris Murphy wrote:
> >> This is on Fedora Rawhide (which is planned to become Fedora 31 due in
> >> October), which no longer provides python2.
> >>
> >> $ ./btrfs-debugfs -b /
> >> /usr/bin/env: ‘python2’: No such file or directory
> >> $
> >>
> >> I expect other distros are going to follow as Python 2.7 EOL is coming
> >> up fast, in 6 months.
> >> https://pythonclock.org/
> > 
> > I just ran it through 2to3-3.7 with -w and the new version seems to work
> > just fine for me, so it seems there is not much porting required.
> 
> I don't think you want to ship that program at all, for end users.

Agreed, it was probably just some helper script for developers but it
never got enough features to be useful.

> It's
> quite horrible, and the -b option even downloads the *entire* extent
> tree to userspace in a very naive way.
> 
> There are way simpler, better performing alternatives...

There are, so let's use them!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: updating btrfs-debugfs to python3?
  2019-06-19 11:30     ` David Sterba
@ 2019-06-19 12:22       ` Hans van Kranenburg
  0 siblings, 0 replies; 5+ messages in thread
From: Hans van Kranenburg @ 2019-06-19 12:22 UTC (permalink / raw)
  To: dsterba, Holger Hoffstätte, Chris Murphy, Btrfs BTRFS

On 6/19/19 1:30 PM, David Sterba wrote:
> On Wed, Jun 19, 2019 at 12:21:34PM +0200, Hans van Kranenburg wrote:
>> On 6/19/19 12:13 PM, Holger Hoffstätte wrote:
>>> On 6/19/19 5:20 AM, Chris Murphy wrote:
>>>> This is on Fedora Rawhide (which is planned to become Fedora 31 due in
>>>> October), which no longer provides python2.
>>>>
>>>> $ ./btrfs-debugfs -b /
>>>> /usr/bin/env: ‘python2’: No such file or directory
>>>> $
>>>>
>>>> I expect other distros are going to follow as Python 2.7 EOL is coming
>>>> up fast, in 6 months.
>>>> https://pythonclock.org/
>>>
>>> I just ran it through 2to3-3.7 with -w and the new version seems to work
>>> just fine for me, so it seems there is not much porting required.
>>
>> I don't think you want to ship that program at all, for end users.
> 
> Agreed, it was probably just some helper script for developers but it
> never got enough features to be useful.
> 
>> It's
>> quite horrible, and the -b option even downloads the *entire* extent
>> tree to userspace in a very naive way.
>>
>> There are way simpler, better performing alternatives...
> 
> There are, so let's use them!

This does the same as btrfs-debugfs -b / :

import btrfs
with btrfs.FileSystem('/') as fs:
  for chunk in fs.chunks():
    print(fs.block_group(chunk.vaddr))

Something like this is in examples/ in python-btrfs, there's no tool in
the collection of nice programs in bin/ in there yet to do this.

I have been thinking about this, and didn't want to hurry it, earlier.

There are quite a lot of those kind of simple searches for information
possible:

https://github.com/knorrie/python-btrfs/issues/18

This would be the online equivalent of doing things with
btrfs-debug-tree, which reads info directly from disk. Processing of the
command line input arguments will be about 95% of all the code of it.

It's also really nice to be able to compare output of both (online,
offline) when your kernel gets into some weird state. I ran into a
situation in the past (rogue parent transid verify failed during balance
/ subvol delete with a btrfs_commit_transaction:2227: errno=-5 IO
failure (Error while writing out transaction)) and then I could see the
corrupted metadata in memory.

K

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-19 12:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19  3:20 updating btrfs-debugfs to python3? Chris Murphy
2019-06-19 10:13 ` Holger Hoffstätte
2019-06-19 10:21   ` Hans van Kranenburg
2019-06-19 11:30     ` David Sterba
2019-06-19 12:22       ` Hans van Kranenburg

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).