lkml.org 
[lkml]   [2007]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [perfmon] Re: [perfmon2] perfmon2 merge news
    From
    From: Paul Mackerras <paulus@samba.org>
    Date: Wed, 14 Nov 2007 22:44:56 +1100

    > For instance, if you have something that kind-of looks like
    >
    > read_pmds(int n, int *pmd_numbers, u64 *pmd_values);
    >
    > where the caller supplies an array of PMD numbers and the function
    > returns their values (and you want that reading to be done atomically
    > in some sense), how would you do that using special files and fops?

    The same way we handle some of the multicast "getsockopt()"
    calls. The parameters passed in are both inputs and outputs.

    For the above example:

    struct pmd_info {
    int *pmd_numbers;
    u64 *pmd_values;
    int n;
    } *p;

    buffer_size = N;
    p = malloc(buffer_size);
    p->pmd_numbers = p + foo;
    p->pmd_values = p + bar;
    p->n = whatever(N);
    err = read(fd, p, N);

    It's definitely doable, use your imagination.

    You can encode all kinds of operation types into the
    header as well.

    Another alternative is to use generic netlink.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-11-14 12:55    [W:3.882 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site