Discussion:
Show application performance/errors from pseudo file
Daniel Hilst Selli
2014-10-16 19:50:04 UTC
Permalink
I'm writing a new application and would be nice to have a pseudo file showing its status, just the way that procfs does with kernel.
I'm looking for sugestions, I want to `cat' files contents and have something similar to /proc/meminfo

First I think using named pipes, but, AFAIK, pipes would retain data writed until someone read it, what I thought is a kind of read
hook that only show data when asked for. Here are a few requisites,

- Don't retain data
- Don't generate disk I/O
- Vanish when application stops
- Work with a simple cat or something similar..

With that in mind I think about using unix domain sockets.. it seems to fit all requisites, for
the fourth requisite I could use netcat, that is almost cat,

Cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
m***@gmail.com
2014-10-16 20:00:43 UTC
Permalink
I=92m no expert but I believe you=92d need a kernel module to create th=
e char device, then have your application talk to it somehow?
http://stackoverflow.com/questions/5970595/create-a-device-node-in-code
I'm writing a new application and would be nice to have a pseudo file=
showing its status, just the way that procfs does with kernel.
I'm looking for sugestions, I want to `cat' files contents and have s=
omething similar to /proc/meminfo
=20
First I think using named pipes, but, AFAIK, pipes would retain data =
writed until someone read it, what I thought is a kind of read
hook that only show data when asked for. Here are a few requisites,
=20
- Don't retain data
- Don't generate disk I/O
- Vanish when application stops
- Work with a simple cat or something similar..
=20
With that in mind I think about using unix domain sockets.. it seems =
to fit all requisites, for
the fourth requisite I could use netcat, that is almost cat,
=20
Cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-c-pro=
gramming" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-c-progr=
amming" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Yichao Yu
2014-10-16 20:31:29 UTC
Permalink
Resend as plain text.
Post by Daniel Hilst Selli
I'm writing a new application and would be nice to have a pseudo file
showing its status, just the way that procfs does with kernel.
I'm looking for sugestions, I want to `cat' files contents and have
something similar to /proc/meminfo
First I think using named pipes, but, AFAIK, pipes would retain data
writed until someone read it, what I thought is a kind of read
hook that only show data when asked for. Here are a few requisites,
- Don't retain data
- Don't generate disk I/O
- Vanish when application stops
- Work with a simple cat or something similar..
You should have a look at fuse[1].
[1] http://fuse.sourceforge.net/
Post by Daniel Hilst Selli
With that in mind I think about using unix domain sockets.. it seems to
fit all requisites, for
the fourth requisite I could use netcat, that is almost cat,
Cheers
--
To unsubscribe from this list: send the line "unsubscribe
linux-c-programming" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Daniel Hilst Selli
2014-10-17 18:59:32 UTC
Permalink
Post by Yichao Yu
Resend as plain text.
Post by Daniel Hilst Selli
I'm writing a new application and would be nice to have a pseudo file
showing its status, just the way that procfs does with kernel.
I'm looking for sugestions, I want to `cat' files contents and have
something similar to /proc/meminfo
First I think using named pipes, but, AFAIK, pipes would retain data
writed until someone read it, what I thought is a kind of read
hook that only show data when asked for. Here are a few requisites,
- Don't retain data
- Don't generate disk I/O
- Vanish when application stops
- Work with a simple cat or something similar..
You should have a look at fuse[1].
[1] http://fuse.sourceforge.net/
Post by Daniel Hilst Selli
With that in mind I think about using unix domain sockets.. it seems to
fit all requisites, for
the fourth requisite I could use netcat, that is almost cat,
Cheers
--
To unsubscribe from this list: send the line "unsubscribe
linux-c-programming" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
Seems god, a little overkill for so simple stuff but adds nice features, I'm taking
a look on further options..

Cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Daniel Hilst Selli
2014-10-17 19:00:23 UTC
Permalink
Post by Daniel Hilst Selli
Post by Yichao Yu
Resend as plain text.
Post by Daniel Hilst Selli
I'm writing a new application and would be nice to have a pseudo file
showing its status, just the way that procfs does with kernel.
I'm looking for sugestions, I want to `cat' files contents and have
something similar to /proc/meminfo
First I think using named pipes, but, AFAIK, pipes would retain data
writed until someone read it, what I thought is a kind of read
hook that only show data when asked for. Here are a few requisites,
- Don't retain data
- Don't generate disk I/O
- Vanish when application stops
- Work with a simple cat or something similar..
You should have a look at fuse[1].
[1] http://fuse.sourceforge.net/
Post by Daniel Hilst Selli
With that in mind I think about using unix domain sockets.. it seems to
fit all requisites, for
the fourth requisite I could use netcat, that is almost cat,
Cheers
--
To unsubscribe from this list: send the line "unsubscribe
linux-c-programming" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
Seems god, a little overkill for so simple stuff but adds nice features, I'm taking
a look on further options..
Cheers
good*
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Continue reading on narkive:
Search results for 'Show application performance/errors from pseudo file' (Questions and Answers)
10
replies
What are TCP, UDP, Proxy, port, local host, ip address?
started 2006-11-26 20:22:29 UTC
computer networking
Loading...