Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psutil-5.4.7 Failes to install on AIX 6.1 #1329

Closed
linhan818612 opened this issue Aug 20, 2018 · 7 comments
Closed

psutil-5.4.7 Failes to install on AIX 6.1 #1329

linhan818612 opened this issue Aug 20, 2018 · 7 comments
Assignees

Comments

@linhan818612
Copy link

I am trying to install psutil 5.4.7 on AIX6.1.There is no pip.
Python2.7.6
python setup.py install
error info:
"psutil/_psutil_aix.c", lin 246.24: 1506-275 (S) Unexpected text procinfo encountered.
"psutil/_psutil_aix.c", lin 246.5: 1506-045 (S) Undeclared identifier perfstat_process_t.
"psutil/_psutil_aix.c", lin 225.33: 1506-045 (S) Undeclared identifier procinfo.
"psutil/_psutil_aix.c", lin 519.22: 1506-022 (S) "if_iqdrops: is not a member of "struct {...}.
"psutil/_psutil_aix.c", lin 519.22: 1506-022 (S) "xmitdrops: is not a member of "struct {...}.

Does anyone have the same problem?

@giampaolo
Copy link
Owner

@wiggin15 any idea?

@wiggin15
Copy link
Collaborator

I assume that AIX 6.1 contains an older version of "libperfstat" that doesn't have these members (xmitdrops and if_iqdrops in perfstat_netinterface_t). I only have AIX 7.1 and AIX 7.2 so I can't verify this, and the versioning / changes in libperfstat aren't documented properly anywhere (we had another problem with undocumented changes to this library in #1154).
This time the struct exists, but its version is different. We'll need to disable net_io_counters based on, probably, CURR_VERSION_NETINTERFACE.
@linhan818612 can you please run on your environment the following command?

grep CURR_VERSION_NETINTERFACE /usr/include/libperfstat.h

On my systems, this value is "3" so we can probably just check for this version.

@wiggin15
Copy link
Collaborator

It's worth noting that AIX 6.1 reached end-of-support more than a year ago (AIX support lifecycle information). Corporate users of AIX move very (very) slowly so it is still in use, but we need to decide whether we support it in psutil.

@giampaolo
Copy link
Owner

giampaolo commented Oct 16, 2018

Corporate users of AIX move very (very) slowly so it is still in use, but we need to decide whether we support it in psutil.

Mmm... I would say it's better to support AIX 6.1 if possible.

We'll need to disable net_io_counters based on, probably, CURR_VERSION_NETINTERFACE.

There's also psutil_proc_io_counters. It probably makes more sense to do a pre-processor check based on the AIX version. Something like this:

// _psutil_aix.c
#ifdef AIX_VERSION_MAJ_6_1_OR_SOMETHING
static PyObject *
psutil_net_io_counters(PyObject *self, PyObject *args) {
    ...
}

static PyObject *
psutil_proc_io_counters(PyObject *self, PyObject *args) {
    ...
}
#endif 

...and in python:

# _psaix.py

if hasattr(cext, "net_io_counters"):
    def net_io_counters():
        ...
  
class Process:
    if hasattr(cext, "proc_io_counters"):
        def io_counters(self):
            ...

PRs are welcome. =)

@wiggin15
Copy link
Collaborator

The problem with checking the AIX version is that availability may also depend on the TL/SP (update levels) installed, because we didn't see this in #1154, which was also about AIX 6.1 but maybe with a newer TL/SP. If we'll try to compare versions we'll have to pinpoint exactly which updates work, and also find preprocessor definitions for the update levels.
Luckily we do have the preprocessor definitions in libperfstat.h that tell us whether structs are available and in what version. I can try to create a PR that checks CURR_VERSION_NETINTERFACE (==3) and CURR_VERSION_PROCESS (the same way we did with CURR_VERSION_THREAD in 70ffd22), but I will have no way to test it.

@giampaolo
Copy link
Owner

Thanks Arnon. I jumped to conclusions too quickly. =)
@linhan818612 could you test the PR?

@wiggin15
Copy link
Collaborator

I was able to get a hold of an AIX machine with 6.1 TL8 SP0 installed (released November 2012). I could not reproduce this problem.

@linhan818612 please specify what TL and SP you are using.

nlevitt added a commit to nlevitt/psutil that referenced this issue Apr 9, 2019
* origin/master: (150 commits)
  Linux / CPU freq, fixes giampaolo#1481
  improve pmap.py script
  reuse ps.py script in psutil.test()
  move get_terminal_size() in _compat.py
  improve ps.py script
  improve ps.py script
  move bytes2human() into psutil._common and reused it from scripts dir
  fix windows failure re. py 2 vs. 3
  fix linux tests
  fix giampaolo#1474: fix formatting of psutil.tests() which mimicks 'ps aux' output
  give CREDITS for giampaolo#1480
  remove outdated tests
  Fix read access violation in psutil.cpu_count(logical=False) (giampaolo#1480)
  update doc
  update doc
  [Win] Process IO priority constants + high priority (giampaolo#1479 / giampaolo#1476)
  don't fail if there are not prev failed tests
  fix giampaolo#1478: add make command to re-run tests failed on last run
  [Win] return value is not properly handled for undocumented NT* Windows APIs. (giampaolo#1477)
  fix error on py 2.7 where OSError doesn't always have winerror attribute
  update HISTORY for giampaolo#1475
  properly check OSError.winerror
  refactor ionice() on Linux
  refactor ionice() on Linux
  ionice test refactoring
  giampaolo#1404: fix regression not returning CPUs > 9
  give CREDITS to Daniel Beer for giampaolo#1471
  Fix spurious exception when iterating processes on Solaris (giampaolo#1471)
  give CREDITS for giampaolo#1470
  Fix corner case when /etc/mtab doesn't exist and procfs=/proc (giampaolo#1470)
  update DEVNOTES
  Typo fixed (giampaolo#1469)
  giampaolo#1458: implement colors on Windows
  update HISTORY / CREDITS, fix some C warnings
  Make uptime type consitent to fix boot time error. (giampaolo#1225)
  fix giampaolo#1463: cpu_distribution.py script is broken
  update issue template
  issue giampaolo#1404 / linux / phys CPUs count
  Big docfix (giampaolo#1464)
  Big docfix (giampaolo#1464)
  Make tests invariant to LANG setting (giampaolo#1462)
  test runner: show errors on KeyboardInterrupt
  test runner refactoring (avoid code duplication)
  Coloured tests (giampaolo#1459)
  pre-release
  [Windows] calculate USS memory by using NtQueryVirtualMemory (giampaolo#1453)
  fix version highlighting in docs/index (giampaolo#1455)
  fix version highlighting in README (giampaolo#1454)
  run win specific tests twice as fast
  test refactoring
  test: avoid failing at import time
  mention how to run tests in INSTALL guide
  giampaolo#1448: fix Wine support due to missing rtlIpv6AddressToStringA
  update HISTORY
  Fix giampaolo#1329: [AIX] disable some functions based on availability in libperfstat (giampaolo#1349)
  bump up version, fix some doc issues
  fix ResourceWarning
  pre-release
  fix giampaolo#1447: we weren't use @wrap_exceptions around oneshot() (doh\!)
  update doc + change git hook location
  update doc
  make pre-release checks/install src dist in a venv
  add new make command to check tar.gz sanity
  move doc; rephrase it a bit
  add issue templates for 'bug' and 'enhancement' types
  remove issue template commited by accident
  Update issue templates
  giampaolo#1291: (BACKWARD-INCOMPATIBLE) remove memory_maps() on OSX
  Restore Win-7 support on GIT master (5.5.1 was OK) (giampaolo#1446)
  try to fix ntext.h
  restore previous def
  fix compiler warning
  fix compiler warning
  fix compiler warning
  fix compiler warning
  take defs from PH
  set proper  SYSTEM_PROCESS_INFORMATION struct from PH
  fix compilation warnings
  giampaolo#1398 / win / cmdline: call NtQueryInformationProcess twice, the first time to get the right buf size (ProcessHacker does this)
  update doc
  better print formatting for print scripts
  fix giampaolo#1442: use python3 as Makefile default
  appveyor: run print scripts after tests
  highlight top 6 slowest calls
  add printerr() and exit() to shared utils module
  add arg parser for ad script
  introduce a new scriptsutils.py private module shared by all internal utils + refactor print_access_speed.py script
  giampaolo#1291 / OSX: mark memory_maps() as deprecated and make it alwats raise AccessDenied
  OSX memory_maps() - add error handling
  add script for to benchmark API calls
  move access_denied script
  _assert_alive() refactor (linux)
  refactor
  fix NetBSD: Process.connections() may return incomplete results if using oneshot() giampaolo#1439
  add win tests related to send_signal(CTRL_C_EVENT) giampaolo#1227
  fix win test
  fix win tests
  fix backslash warnings
  refactor README a bit
  #fix 1438: do not return any parent() for PID 0 + update doc
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants