11 Oct, 2010

7 commits

  • Now that we've got a generic perf-events based oprofile backend we might
    as well make use of it seeing as SH doesn't do anything special with its
    oprofile backend. Also introduce a new CONFIG_HW_PERF_EVENTS symbol so
    that we can fallback to using the timer interrupt for oprofile if the
    CPU doesn't support perf events.

    Also, to avoid a section mismatch warning we need to annotate
    oprofile_arch_exit() with an __exit marker.

    Signed-off-by: Matt Fleming
    Acked-by: Paul Mundt
    Signed-off-by: Robert Richter

    Matt Fleming
     
  • Move the perf-events backend from arch/arm/oprofile into
    drivers/oprofile so that the code can be shared between architectures.

    This allows each architecture to maintain only a single copy of the PMU
    accessor functions instead of one for both perf and OProfile. It also
    becomes possible for other architectures to delete much of their
    OProfile code in favour of the common code now available in
    drivers/oprofile/oprofile_perf.c.

    Signed-off-by: Matt Fleming
    Tested-by: Will Deacon
    Signed-off-by: Robert Richter

    Matt Fleming
     
  • In preparation for moving the majority of this oprofile code into an
    architecture-neutral place separate the architecture-independent code
    into oprofile_perf_init() and oprofile_perf_exit().

    Signed-off-by: Matt Fleming
    Tested-by: Will Deacon
    Signed-off-by: Robert Richter

    Matt Fleming
     
  • In preparation for moving the generic functions out of this file, give
    the functions more general names (e.g. remove "arm" from the names).

    Signed-off-by: Matt Fleming
    Tested-by: Will Deacon
    Signed-off-by: Robert Richter

    Matt Fleming
     
  • Make op_name_from_perf_id() global so that we have a way for each
    architecture to construct an oprofile name for op->cpu_type. We need to
    remove the argument from the function prototype so that we can hide all
    implementation details inside the function.

    Signed-off-by: Matt Fleming
    Signed-off-by: Robert Richter

    Matt Fleming
     
  • Introduce perf_pmu_name() helper function that returns the name of the
    pmu. This gives us a generic way to get the name of a pmu regardless of
    how an architecture identifies it internally.

    Signed-off-by: Matt Fleming
    Acked-by: Peter Zijlstra
    Acked-by: Paul Mundt
    Signed-off-by: Robert Richter

    Matt Fleming
     
  • The number of counters for the registered pmu is needed in a few places
    so provide a helper function that returns this number.

    Signed-off-by: Matt Fleming
    Tested-by: Will Deacon
    Acked-by: Paul Mundt
    Acked-by: Peter Zijlstra
    Signed-off-by: Robert Richter

    Matt Fleming
     

31 Aug, 2010

3 commits

  • The pointers must be NULL'ed to avoid double-freeing the pointers in
    rare cases during reinitialization.

    Signed-off-by: Robert Richter

    Robert Richter
     
  • Now that oprofile_arch_exit is only called when the OProfile module
    is unloaded, it can assume that init completed successfully and not
    have to worry about double frees or releasing NULL perf events.

    This patch ensures that oprofile_arch_init fails gracefully on ARM
    and simplifies the exit code based on the above.

    Cc: Robert Richter
    Cc: Matt Fleming
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Signed-off-by: Will Deacon
    Signed-off-by: Robert Richter

    Will Deacon
     
  • oprofile_init calls oprofile_arch_init to initialise the architecture-specific
    backend code. If this backend code returns failure, oprofile_arch_exit is
    called immediately, making it difficult to allocate and free resources
    correctly.

    This patch removes the oprofile_arch_exit call from oprofile_init,
    meaning that all architectures must ensure that oprofile_arch_init
    cleans up any mess it's made before returning an error. As far as
    I can tell, this only affects the code for ARM.

    Cc: Robert Richter
    Cc: Matt Fleming
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Signed-off-by: Will Deacon
    Signed-off-by: Robert Richter

    Will Deacon
     

29 Aug, 2010

25 commits


28 Aug, 2010

5 commits

  • There were some new formats added in commit 15c0cee6c809 "ALSA: pcm:
    Define G723 3-bit and 5-bit formats". That commit increased
    SNDRV_PCM_FORMAT_LAST as well. My concern is that there are a couple
    places which do:

    for (i = 0; i < SNDRV_PCM_FORMAT_LAST; i++) {
    if (dummy->pcm_hw.formats & (1ULL << i))
    snd_iprintf(buffer, " %s", snd_pcm_format_name(i));
    }

    I haven't tested these but it looks like if "i" were equal to
    SNDRV_PCM_FORMAT_G723_24 or higher then we might read past the end of
    the array.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Takashi Iwai

    Dan Carpenter
     
  • The spinlock lock in sound_timer.c is used without initialization.

    Signed-off-by: Akinobu Mita
    Signed-off-by: Takashi Iwai

    Akinobu Mita
     
  • If hw error is ignored, status is updated with invalid info.

    Signed-off-by: Eliot Blennerhassett
    Signed-off-by: Takashi Iwai

    Eliot Blennerhassett
     
  • The string clone is only used as a temporary copy of the argument val
    within the while loop, and so it should be freed before leaving the
    function. The call to strsep, however, modifies clone, so a pointer to the
    front of the string is kept in saved_clone, to make it possible to free it.

    The sematic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r exists@
    local idexpression x;
    expression E;
    identifier l;
    statement S;
    @@

    *x= \(kasprintf\|kstrdup\)(...);
    ...
    if (x == NULL) S
    ... when != kfree(x)
    when != E = x
    if (...) {

    * return ...;
    }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     
  • The fsnotify main loop has 2 bools which indicated if we processed the
    inode or vfsmount mark in that particular pass through the loop. These
    bool can we replaced with the inode_group and vfsmount_group variables
    and actually make the code a little easier to understand.

    Signed-off-by: Eric Paris

    Eric Paris