~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/daemon/OprofileDaemonOptions.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2012-06-29 12:07:30 UTC
  • Revision ID: package-import@ubuntu.com-20120629120730-bfri1xys1i71dpn6
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
 * Copyright (c) 2004, 2008, 2009 Red Hat, Inc.
 
3
 * All rights reserved. This program and the accompanying materials
 
4
 * are made available under the terms of the Eclipse Public License v1.0
 
5
 * which accompanies this distribution, and is available at
 
6
 * http://www.eclipse.org/legal/epl-v10.html
 
7
 *
 
8
 * Contributors:
 
9
 *    Keith Seitz <keiths@redhat.com> - initial API and implementation
 
10
 *    Kent Sebastian <ksebasti@redhat.com>
 
11
 *******************************************************************************/ 
 
12
package org.eclipse.linuxtools.internal.oprofile.core.daemon;
 
13
 
 
14
 
 
15
/**
 
16
 * This class represents the global launch options for the
 
17
 * OProfile daemon.
 
18
 */
 
19
public class OprofileDaemonOptions {
 
20
        // Kernel image file
 
21
        private String kernelImageFile;
 
22
        
 
23
        // Enable verbose logging?
 
24
        private boolean verboseLogging;
 
25
        
 
26
        // How to separate profiles (mask)
 
27
        private int separateProfiles;
 
28
        
 
29
        // the image to profile
 
30
        private String binaryImage;
 
31
        
 
32
        //how many calls down to profile
 
33
        private int callgraphDepth;
 
34
        
 
35
        /**
 
36
         * Sample separation options. Determines how oprofiled will group
 
37
         *   samples for binaries which isn't the main binary being profiled.
 
38
         *   
 
39
         * Currently only properly support:
 
40
         *   -none: ignore all other binaries
 
41
         *   -library: include shared library samples
 
42
         *   -kernel: include kernel module samples (which implicitly includes library)
 
43
         *   
 
44
         *   the others probably wouldn't show nicely in the view
 
45
         */
 
46
        public static final int SEPARATE_NONE = 0;
 
47
        public static final int SEPARATE_LIBRARY = 1;
 
48
        public static final int SEPARATE_KERNEL = 2;
 
49
        public static final int SEPARATE_THREAD = 4;
 
50
        public static final int SEPARATE_CPU = 8;
 
51
        
 
52
        public OprofileDaemonOptions() {
 
53
                //defaults
 
54
                kernelImageFile = ""; //$NON-NLS-1$
 
55
                verboseLogging = false;
 
56
                separateProfiles = SEPARATE_NONE;       
 
57
                binaryImage = ""; //$NON-NLS-1$
 
58
                callgraphDepth = 0;
 
59
        }
 
60
        
 
61
        /**
 
62
         * Get the kernel image file
 
63
         * @return the kernel image file
 
64
         */
 
65
        public String getKernelImageFile() {
 
66
                return kernelImageFile;
 
67
        }
 
68
        
 
69
        /**
 
70
         * Set the kernel image file
 
71
         * @param image the kernel image
 
72
         */
 
73
        public void setKernelImageFile(String image) {
 
74
                kernelImageFile = image;
 
75
        }
 
76
 
 
77
        /**
 
78
         * Get daemon verbose logging
 
79
         * @return whether verbose logging is enabled
 
80
         */
 
81
        public boolean getVerboseLogging() {
 
82
                return verboseLogging;
 
83
        }
 
84
        
 
85
        /**
 
86
         * Set daemon verbose logging
 
87
         * @param logging whether to enable verbose logging
 
88
         */
 
89
        public void setVerboseLogging(boolean logging) {
 
90
                verboseLogging = logging;
 
91
        }
 
92
 
 
93
        /**
 
94
         * Get daemon profile separation mask
 
95
         * @return mask of options
 
96
         */
 
97
        public int getSeparateProfilesMask() {
 
98
                return separateProfiles;
 
99
        }
 
100
        
 
101
        /**
 
102
         * Set daemon profile separation mask
 
103
         * @param mask the new separation mask
 
104
         */
 
105
        public void setSeparateProfilesMask(int mask) {
 
106
                separateProfiles = mask;
 
107
        }
 
108
 
 
109
        /**
 
110
         * Get the path to the binary image being profiled.
 
111
         * @return full path to the binary
 
112
         */
 
113
        public String getBinaryImage() {
 
114
                return binaryImage;
 
115
        }
 
116
 
 
117
        /**
 
118
         * Sets the path of the binary image to profile.
 
119
         * @param image full path to the binary
 
120
         */
 
121
        public void setBinaryImage(String image) {
 
122
                this.binaryImage = image;
 
123
        }
 
124
 
 
125
        /**
 
126
         * Get the call depth value.
 
127
         * @return integer amount of calls down to profile
 
128
         */
 
129
        public int getCallgraphDepth() {
 
130
                return callgraphDepth;
 
131
        }
 
132
 
 
133
        /**
 
134
         * Sets the call depth value.
 
135
         * @param depth integer amount of calls down to profile
 
136
         */
 
137
        public void setCallgraphDepth(int depth) {
 
138
                this.callgraphDepth = depth;
 
139
        }
 
140
}