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

Some posible new features? #21

Open
DFOXpro opened this issue Jun 16, 2015 · 16 comments
Open

Some posible new features? #21

DFOXpro opened this issue Jun 16, 2015 · 16 comments

Comments

@DFOXpro
Copy link

DFOXpro commented Jun 16, 2015

  • Is possible to set this program like a daemon ? and get the data with a sysfile or netservice.
  • Is possible to this program get the clock of the card? like aticonfig & amdoverdrive.

Thank you for this program, this become the solution for amdoverdrive-data in radeon opensource ;)

@clbr
Copy link
Owner

clbr commented Jun 16, 2015 via email

@DFOXpro
Copy link
Author

DFOXpro commented Jun 16, 2015

thanks again, I will use your program to monitor within a Conky panel.

@DFOXpro
Copy link
Author

DFOXpro commented Jun 17, 2015

Is posible with --dump option to write the file without adding more lines?
or -d - (stdout option) to have an EOF for 1 data show.
Why: If you use the --dump option, the dump file with the time will be bigger and bigger, and the -d - option, if you set a listener (my case via nc)(sudo radeontop -t 50 - | nc -l ) will not know how get the next data show, because is continuous and have no EOF.

@ldsh
Copy link

ldsh commented Jun 17, 2015

Hello @DFOXpro
I once made some modifications of raddeontop in order to display some informations in my conky.
I did change the source code to make it dump only one line in the file and replace it instead of adding it to the file.
You can find it there: https://github.com/ldsh/radeonload
Please be aware that I made it two years ago (no update since) with really basics skills.

I suggest you to take a look for inspiration and make a new one in order to have the latest advancement of the radeontop original repository (I do not maintain mine).
The main modification I made was to change f = fopen(file, "a"); to f = fopen(file, "w+");, so that the file is erased between each writings.

I'll not work on this soon as I don't have radeon card any more (the motherboard were mine was soldered is dead).

Maybe @clbr would be interested to modify his own code to add this possibility to his dump command as it seems I'm not the only one that was interested in?

Hope it helps.

@clbr
Copy link
Owner

clbr commented Jun 17, 2015

A --rewind argument would be ok to add, though this is the first I hear
of the need for such. I'm a bit on the fence, as you can get the last
line with a simple bash script. Writing it to a file, to network, or
somewhere else after only parsing the desired numbers would be easy.

#!/bin/sh
IFS="
"
while read LINE; do
echo got line $LINE
done

@ldsh
Copy link

ldsh commented Jun 17, 2015

The idea is to benefit from your daemon feature but not having a file unnecessary growing as the goal is to have it running at startup (until shutdown) but only to have the last information.

Your daemon (at least what I remember from when I looked 2 years ago) is keeping all the data in the file, this is good to have if you want to see how this data have evolved in time, but not that much if you only wants to access the last data (in a memory point of view. I put the file in tmpfs to avoid disk writes, but having a file that don't stop growing is similar to a memory leak in the process).

The main modification I made was to change f = fopen(file, "a"); to f = fopen(file, "w+");, so that the file is erased between each writings.

Of course, there may be a more elegant way to pass the wanted data from radeontop to Conky, writing them in a file is still some kind of overhead. The thing is that reading data from a file is a basic Conky feature and do not need root access.

@clbr
Copy link
Owner

clbr commented Jun 17, 2015 via email

@ldsh
Copy link

ldsh commented Jun 17, 2015

I remember now why I didn't use something like you suggest, that was to avoid giving root rights to Conky as some peoples says it is not recommended (maybe it would worth to know how far theses recommendations are usefull?)
Thus the daemon at start-up was a workaround to give the rights only to the radeontop daemon, Conky having enough with user rights to read the file.

However, if this permission issue is not considered as a thread, piping the commends would indeed be a simple solution.

@nckx
Copy link
Contributor

nckx commented Jun 17, 2015

Why not just create a simple shell script wrapper (or use sh -c directly) to do this?

radeontop -d- | while read line; do echo "$line" > "$1"; done

or so. Teh unix way, and all that.

@clbr
Copy link
Owner

clbr commented Jun 17, 2015 via email

@ldsh
Copy link

ldsh commented Jun 17, 2015

May be a better workaround, @DFOXpro can you test it and report if the result satisfy you?
(I can't test it myself, no working radeon card to test on)

@myxal
Copy link

myxal commented Jan 14, 2016

Any plans for SIGWINCH support? (run-time terminal resizing)

@clbr
Copy link
Owner

clbr commented Jan 15, 2016

On Thu, 14 Jan 2016 15:23:33 -0800
myxal notifications@github.com wrote:

Any plans for SIGWINCH support? (run-time terminal resizing)

Patches welcome.

@ZeWebDev
Copy link

ZeWebDev commented May 5, 2018

I am currently using this as a daemon. I made a script like the one you posted. Problem is that 2 new lines are created every time it dumps new information, so i get 1 empty line and nothing gets written to the file.

Of course you go around this with just an 'if' but i think it would be preferable to not have any empty lines between dumps

@clbr
Copy link
Owner

clbr commented May 5, 2018

I don't get any empty line? If you look at the output, "radeontop -d -", there is exactly one line per.

@clbr
Copy link
Owner

clbr commented May 5, 2018

Oh, scratch that, I see it now. Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants