lkml.org 
[lkml]   [2018]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 5/9] perf utils: add support for arch standard events
    On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote:

    SNIP

    > + rc = nftw(ldirname, preprocess_arch_std_files, get_maxfds(), 0);
    > + if (rc && verbose) {
    > + pr_info("%s: Error preprocessing arch standard files %s\n",
    > + prog, ldirname);
    > + goto empty_map;
    > + } else if (rc < 0) {
    > + /* Make build fail */
    > + return 1;
    > + }
    > rc = nftw(ldirname, process_one_file, maxfds, 0);
    > if (rc && verbose) {
    > pr_info("%s: Error walking file tree %s\n", prog, ldirname);
    > - goto empty_map;
    > + goto free_standard_arch_events;
    > } else if (rc < 0) {
    > /* Make build fail */
    > return 1;
    > - } else if (rc) {
    > - goto empty_map;
    > }
    >
    > + /* Free memories for architecture standard events */
    > + list_for_each_entry_safe(es1, es2, &arch_std_events, list)
    > + free(es1);
    > +
    > if (close_table)
    > print_events_table_suffix(eventsfp);
    >
    > @@ -1011,6 +1173,9 @@ int main(int argc, char *argv[])
    >
    > return 0;
    >
    > +free_standard_arch_events:
    > + list_for_each_entry_safe(es1, es2, &arch_std_events, list)
    > + free(es1);

    that could go into a function and be used also above

    thanks,
    jirka

    \
     
     \ /
      Last update: 2018-02-08 14:57    [W:2.332 / U:0.748 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site