Live data from Hacker News

mactop

github.com

21–30 of 31 posts

Re: mactop

#21
post #17
post #16

Why does this require elevated privileges to run? Seems ridiculous for a top-like tool.

even htop needs sudo to run properly

What htop features are unavailable if you don't run it with elevated privileges?

Re: mactop

#22
post #16

Why does this require elevated privileges to run? Seems ridiculous for a top-like tool.

Tools like these need to be able to read various counters and other registers in the hardware. Note that powermetrics existed in MacOs since the Intel days and mirrors a lot of the x86 information provided by the Intel tool on Linux (the name of which escapes me at the moment). You really don't want to give unprivileged code access to this data (check out the man page to see all of the information it can give you). I…

The Linux tool is called Intel powertop.

How do Activity Monitor and AlDente get detailed power data? They don't prompt me to elevate privileges.

tyvm for the docs links! I still don't have any specifics in mind for useful attacks one could carry out using the data mentioned in `man powermetrics`. I assume the worry is that this stuff could play a role in some kinds of side-channel attacks but idrk much about low-level OS stuff. :-\

Re: mactop

#23

The sudo permission should be added by brew at install time (see how the dotnet SDK handles installation on macs), it's poor ergonomics to have to invoke it manually.

The sudo is for the runtime permissions, not the installation, of the program. dotnet requires (does it? it's been a while since I touched it but I vaguely recall this) sudo for installation, but not for execution.

Regarding .NET:

• .NET installers install to systemwide locations and therefore typically require elevated privileges.

• Microsoft supplies both install scripts (dotnet-install) and .tar.gz/.zip archives to support unprivileged installation to arbitrary locations on all supported platforms.

• The SDK and self-contained .NET executables run from anywhere, but certain SDK functionality may require elevated privileges on some platforms (e.g., installing a trusted self-signed developer certificate).

• Framework-dependent executables use the DOTNET_ROOT environment variable to locate runtime components installed in a non-default location.

Re: mactop

#24
post #22

Earlier quoted context omitted.

Tools like these need to be able to read various counters and other registers in the hardware. Note that powermetrics existed in MacOs since the Intel days and mirrors a lot of the x86 information provided by the Intel tool on Linux (the name of which escapes me at the moment). You really don't want to give unprivileged code access to this data (check out the man page to see all of the information it can give you). I…

The Linux tool is called Intel powertop. How do Activity Monitor and AlDente get detailed power data? They don't prompt me to elevate privileges. tyvm for the docs links! I still don't have any specifics in mind for useful attacks one could carry out using the data mentioned in `man powermetrics`. I assume the worry is that this stuff could play a role in some kinds of side-channel attacks but idrk much about low-lev…

I don't think that Activity Monitor is getting detailed info and thus doesn't need root. You can also get the same kind of info from powermetrics without root.

(it's been a while since I've messed with this stuff, I could be missing some details)

Re: mactop

#25

Very nice, an instant addition to my $PATH. In particular I like having the ANE usage displayed, as this is typically invisible in other top-like tools.

I gave it a try for the past few hours on a worker Mac and it's nice, but its own CPU usage is very high and proportional to the size of the terminal. With a fullscreen terminal (271x63 for me) it pegs an entire CPU continuously.

Re: mactop

#26

Tried to install via brew on an M2 and got: mactop: The arm64 architecture is required for this software. Error: mactop: An unsatisfied requirement failed this build.

Is your homebrew still running as intel under Rosetta?

Re: mactop

#27
post #26

Tried to install via brew on an M2 and got: mactop: The arm64 architecture is required for this software. Error: mactop: An unsatisfied requirement failed this build.

Is your homebrew still running as intel under Rosetta?

Ah - that could be it. I did use Time Machine from an Intel iMac to set up this up

Re: mactop

#28
post #21
post #17

Earlier quoted context omitted.

even htop needs sudo to run properly

What htop features are unavailable if you don't run it with elevated privileges?

The only thing I have noticed is the ability to kill/strace processes belong to other users. But that's a given.

Re: mactop

#29
post #26

Tried to install via brew on an M2 and got: mactop: The arm64 architecture is required for this software. Error: mactop: An unsatisfied requirement failed this build.

Is your homebrew still running as intel under Rosetta?

Thanks - that got it.

I followed the steps to uninstall and reinstall, but it didn't work until I manually added this to ~/.bash_profile:

export PATH=/opt/homebrew/bin:$PATH

Post reply on HN