mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Knutar <jk-lkml@sci.fi>
To: Scott Bronson <bronson@rinspin.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: Getting the page size of currently running kernel
Date: Sun, 20 Feb 2005 05:22:43 +0200	[thread overview]
Message-ID: <200502200522.43321.jk-lkml@sci.fi> (raw)
In-Reply-To: <200502191901.57425.bronson@rinspin.com>

On Sunday 20 February 2005 05:01, Scott Bronson wrote:
> Is there any way to get a running kernel to tell you the size of its pages?
> 
> Why: I'm writing a quick Perl hack to monitor the memory usage of the TCP 
> stack over time.  Easy enough: /proc/net/sockstat gives the current value of 
> tcp_memory_allocated.  But how do I convert this into bytes?  I don't want to 
> hard code PAGE_SIZE into my Perl script, complete with a lookup table for 4K 
> vs. 8K architectures!  Am I missing something obvious here?

Can you call functions in glibc through perl?
If so, then getpagesize(2) is what you're looking for.
Can you do raw syscalls in perl, if so, you could get the same info that way.


  reply	other threads:[~2005-02-20  3:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-20  3:01 Scott Bronson
2005-02-20  3:22 ` Jan Knutar [this message]
2005-02-20  3:28 ` Roland Dreier
2005-02-20  4:39   ` Scott Bronson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200502200522.43321.jk-lkml@sci.fi \
    --to=jk-lkml@sci.fi \
    --cc=bronson@rinspin.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®