htop icon indicating copy to clipboard operation
htop copied to clipboard

WIP: AIX support

Open NattyNarwhal opened this issue 7 years ago • 8 comments

Obsoletes the previous issue. Early on, lots of stdbool twiddling, then the real meat.

What works:

  • Mostly everything, except:

  • strace flags need to be changed?

  • IBM i support is partial; CPU meters, uptime, and load averages won't work due to lack of libperfstat, functional utmp, and no load average generation

  • No battery, obviously

  • The CPU meter algorithm is a little sketchy looking

For the AIX experts in the audience, you'll notice I'm taking great care not to use anything like libperfstat/ODM/WLM or worse, getting kernel symbols and twiddling them directly. This is due to a desire to keep it (mostly functional as possible) under IBM i's PASE. The most I use is an undocumented syscall in public headers to get the load average, and even then, its ifdefed out (but harmless anyways) under PASE.

A function from OpenBSD was lifted, but it seems this is OK legally speaking, seeing as the OpenBSD support in htop uses code borrowed from OpenBSD?

NattyNarwhal avatar Aug 23 '18 03:08 NattyNarwhal

Warmer: memory meter works, (though a cosmetic glitch in bar mode?) libperfstat is used when applicable, (won't be used under i, so things there will basically be no-ops) and the swap meter. CPU is the next thing to work on, and that looks a bit hairy.

Screenshot

NattyNarwhal avatar Aug 23 '18 17:08 NattyNarwhal

all the basic features should be working now. the memory usage meters don't seem 100% right to me, however, so I might continue tweaking those values. Feel free to look at this patch now.

NattyNarwhal avatar Aug 24 '18 22:08 NattyNarwhal

Merge conflict resolved, Would appreciate review.

NattyNarwhal avatar Aug 27 '18 17:08 NattyNarwhal

Thank you for the contribution! This is a big one, I'll need to set some time aside to give it a proper review. but I will definitely get to it.

hishamhm avatar Aug 28 '18 17:08 hishamhm

I just pushed something that also makes it work on IBM i's AIX syscall emulator, albeit with some functionality downgrades due to limitations there. I've been using htop with this PR on an AIX system however, and it mostly seems to work fine over the months I've been using it. The data sampling for CPU/memory isn't perfect, but it works.

Let me know about mergeability when you have the time.

NattyNarwhal avatar Dec 07 '18 15:12 NattyNarwhal

Can't wait for this to be merged

bmarwell avatar Feb 10 '20 16:02 bmarwell

Some of the suggestions made. A lot of this is quirks of htop itself and its build system... and also me from two years ago being pretty dumb.

NattyNarwhal avatar Feb 22 '20 19:02 NattyNarwhal

Hi. I tested the PR about two weeks ago. Had some problems with the default colour scheme, but the overview (main page) worked just fine.

If you need me to test sth on AIX 7.2, just tell me.

bmarwell avatar Feb 22 '20 20:02 bmarwell